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>
42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?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());
|
|
}
|
|
}
|
|
}
|