Skip to content

Commit 5209343

Browse files
committed
Add DateTimeType validation to architecture tests
- Included `DateTimeType` in structure tests to ensure that `PhpTypedValues\DateTime` classes extend `DateTimeType`, are final, and read-only.
1 parent a8b4a4a commit 5209343

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/Arch/StructureTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
declare(strict_types=1);
44

5+
use PhpTypedValues\Code\DateTime\DateTimeType;
56
use PhpTypedValues\Code\Float\FloatType;
67
use PhpTypedValues\Code\Integer\IntType;
78
use PhpTypedValues\Code\String\StrType;
@@ -32,3 +33,10 @@
3233
->toBeClasses()
3334
->toBeFinal()
3435
->toBeReadonly();
36+
37+
arch('Datetime classes are final and read-only')
38+
->expect('PhpTypedValues\DateTime')
39+
->toExtend(DateTimeType::class)
40+
->toBeClasses()
41+
->toBeFinal()
42+
->toBeReadonly();

0 commit comments

Comments
 (0)