66use org \bovigo \vfs \vfsStreamDirectory ;
77use PHPUnit \Framework \TestCase ;
88use ReallifeKip \ImmutableBase \Attributes \ArrayOf ;
9+ use ReallifeKip \ImmutableBase \Attributes \KeepOnNull ;
10+ use ReallifeKip \ImmutableBase \Attributes \Lax ;
11+ use ReallifeKip \ImmutableBase \Attributes \SkipOnNull ;
12+ use ReallifeKip \ImmutableBase \Attributes \Spec ;
13+ use ReallifeKip \ImmutableBase \Attributes \Strict ;
14+ use ReallifeKip \ImmutableBase \Attributes \ValidateFromSelf ;
915use ReallifeKip \ImmutableBase \CLI \Cacher ;
1016use ReallifeKip \ImmutableBase \Exceptions \DefinitionExceptions \DebugLogDirectoryInvalidException ;
1117use ReallifeKip \ImmutableBase \Exceptions \DefinitionExceptions \InvalidArrayOfTargetException ;
2026use ReallifeKip \ImmutableBase \Exceptions \ValidationExceptions \StrictViolationException ;
2127use ReallifeKip \ImmutableBase \ImmutableBase ;
2228use ReallifeKip \ImmutableBase \StaticStatus ;
29+ use ReflectionClass ;
2330use Tests \DataTransferObjects \DTO ;
2431use Tests \DataTransferObjects \EmptyArrayOfClassDTO ;
2532use Tests \DataTransferObjects \ExtraDTO ;
@@ -206,7 +213,6 @@ public function testBasic()
206213 ImmutableBase::strict (true );
207214 LaxDTO::fromArray ([]);
208215 ImmutableBase::strict (false );
209- new ArrayOf ('' );
210216 $ nestedDTO = NestedVO::fromArray ([
211217 'nested2 ' => [
212218 'value ' => 'svo ' ,
@@ -216,6 +222,24 @@ public function testBasic()
216222 UnionWithImmutableBaseTypeDTO::fromArray ([
217223 'mixed ' => DTO ::fromArray ($ this ->array ),
218224 ]);
225+
226+ foreach (
227+ [
228+ ArrayOf::class,
229+ KeepOnNull::class,
230+ Lax::class,
231+ SkipOnNull::class,
232+ Spec::class,
233+ Strict::class,
234+ ValidateFromSelf::class,
235+ ] as $ class
236+ ) {
237+ $ ref = new ReflectionClass ($ class );
238+ $ constructor = $ ref ->getConstructor ();
239+ $ constructor ->setAccessible (true );
240+ $ instance = $ ref ->newInstanceWithoutConstructor ();
241+ $ constructor ->invoke ($ instance , '' );
242+ }
219243 }
220244 public function testBasicWithCache ()
221245 {
0 commit comments