CaiWuXiTong/tests/Unit/FinanceLedgerAccountShouldKeepTest.php
shanshi e76e87e4db feat(财务台账): 发布银行账单与账户资金管理 (#1385)
发布银行账单、账户资金管理、公司规划分布与余额联动。
2026-11-25 09:14:24 +08:00

37 lines
1.2 KiB
PHP

<?php
namespace Tests\Unit;
use App\Utilities\FinanceLedgerAccountShouldKeep;
use PHPUnit\Framework\TestCase;
class FinanceLedgerAccountShouldKeepTest extends TestCase
{
public function test_company_plan_not_retained_defaults_to_temporary_retention(): void
{
$this->assertSame(
FinanceLedgerAccountShouldKeep::TEMPORARY,
FinanceLedgerAccountShouldKeep::display(null, '不保留'),
);
$this->assertSame('暂时保留', FinanceLedgerAccountShouldKeep::label(null, '不保留'));
}
public function test_explicit_not_retained_overrides_company_plan(): void
{
$this->assertSame(
FinanceLedgerAccountShouldKeep::NO,
FinanceLedgerAccountShouldKeep::display('否', '不保留'),
);
$this->assertSame('不保留', FinanceLedgerAccountShouldKeep::label('否', '不保留'));
}
public function test_temporary_retention_remains_a_retained_state(): void
{
$this->assertSame(
FinanceLedgerAccountShouldKeep::TEMPORARY,
FinanceLedgerAccountShouldKeep::normalize('暂时保留'),
);
$this->assertSame('暂时保留', FinanceLedgerAccountShouldKeep::label('暂时保留', '保留'));
}
}