feat(form-builder): add ApplyStatus, DismissalReasonType, BindingTargetType enums (WS-6)
DismissalReasonType has six values; manually_resolved is intentionally absent because Resolve and Dismiss are separate workflows (RFC V2). Refs: RFC-WS-6.md §3 (Q4 partial-status separation), §4 (V2 dismiss enum) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
41
api/tests/Unit/Enums/FormBuilder/ApplyStatusTest.php
Normal file
41
api/tests/Unit/Enums/FormBuilder/ApplyStatusTest.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Tests\Unit\Enums\FormBuilder;
|
||||
|
||||
use App\Enums\FormBuilder\ApplyStatus;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
final class ApplyStatusTest extends TestCase
|
||||
{
|
||||
public function test_has_four_cases_with_stable_values(): void
|
||||
{
|
||||
$values = array_map(fn (ApplyStatus $case) => $case->value, ApplyStatus::cases());
|
||||
sort($values);
|
||||
$this->assertSame(['completed', 'failed', 'partial', 'pending'], $values);
|
||||
}
|
||||
|
||||
public function test_is_terminal_truth_table(): void
|
||||
{
|
||||
$this->assertFalse(ApplyStatus::PENDING->isTerminal());
|
||||
$this->assertTrue(ApplyStatus::COMPLETED->isTerminal());
|
||||
$this->assertTrue(ApplyStatus::PARTIAL->isTerminal());
|
||||
$this->assertTrue(ApplyStatus::FAILED->isTerminal());
|
||||
}
|
||||
|
||||
public function test_is_open_truth_table(): void
|
||||
{
|
||||
$this->assertTrue(ApplyStatus::PENDING->isOpen());
|
||||
$this->assertFalse(ApplyStatus::COMPLETED->isOpen());
|
||||
$this->assertTrue(ApplyStatus::PARTIAL->isOpen());
|
||||
$this->assertTrue(ApplyStatus::FAILED->isOpen());
|
||||
}
|
||||
|
||||
public function test_label_returns_non_empty_dutch_string_for_each_case(): void
|
||||
{
|
||||
foreach (ApplyStatus::cases() as $case) {
|
||||
$this->assertNotSame('', $case->label());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user