feat(forms): add PHP enums for form builder

9 backed string enums covering purpose, field type, submission status/mode/review,
field width, value storage hint, snapshot mode, webhook delivery status.
FormPurpose/FormFieldType include helper methods per ARCH §3/§5. All with
declare(strict_types=1) and values() helpers for validation rules.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 11:27:01 +02:00
parent 032ad9d953
commit 135bdb352c
18 changed files with 731 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Tests\Unit\Enums\FormBuilder;
use App\Enums\FormBuilder\FormSchemaSnapshotMode;
use PHPUnit\Framework\TestCase;
class FormSchemaSnapshotModeTest extends TestCase
{
public function test_has_expected_cases(): void
{
$this->assertSame('never', FormSchemaSnapshotMode::NEVER->value);
$this->assertSame('on_submit', FormSchemaSnapshotMode::ON_SUBMIT->value);
$this->assertSame('always', FormSchemaSnapshotMode::ALWAYS->value);
$this->assertCount(3, FormSchemaSnapshotMode::cases());
}
public function test_values_returns_string_array(): void
{
$this->assertSame(['never', 'on_submit', 'always'], FormSchemaSnapshotMode::values());
}
}