@@ -18,7 +18,7 @@ final class ArraySchemaValidatorTest extends BaseCodegenTestCase {
1818 }
1919
2020 public function testArrayOfStringsInvalidRoot (): void {
21- $validator = new ArraySchemaValidator (vec [' test' , ' list' , ' of' , ' strings' ]);
21+ $validator = new ArraySchemaValidator (varray [' test' , ' list' , ' of' , ' strings' ]);
2222 $validator -> validate();
2323
2424 expect ($validator -> isValid())-> toBeFalse();
@@ -36,26 +36,28 @@ public function testArrayOfStringsValid(): void {
3636 }
3737
3838 public function testArrayOfStringsLegacyArrays (): void {
39- $validator = new ArraySchemaValidator (darray [' array_of_strings' => vec [' test' , ' list' , ' of' , ' strings' ]]);
39+ $validator = new ArraySchemaValidator (darray [' array_of_strings' => varray [' test' , ' list' , ' of' , ' strings' ]]);
4040 $validator -> validate();
4141
4242 expect ($validator -> isValid())-> toBeTrue();
4343 $validated = $validator -> getValidatedInput();
4444 expect (C \count ($validated [' array_of_strings' ] ?? vec []))-> toBeSame(4 );
4545 }
4646
47- public function testDictOfStringsInvalid (): void {
47+ public function testArrayOfStringsLegacyAndHackArrays (): void {
4848 $validator = new ArraySchemaValidator (dict [
49- ' array_of_strings' => dict [' test' => ' test ' ],
49+ ' array_of_strings' => varray [' test' , ' list ' , ' of ' , ' strings ' ],
5050 ]);
5151 $validator -> validate();
5252
53- expect ($validator -> isValid())-> toBeFalse();
53+ expect ($validator -> isValid())-> toBeTrue();
54+ $validated = $validator -> getValidatedInput();
55+ expect (C \count ($validated [' array_of_strings' ] ?? vec []))-> toBeSame(4 );
5456 }
5557
5658 public function testUntypedArrayValid (): void {
5759 $validator = new ArraySchemaValidator (dict [
58- ' untyped_array' => vec [' test' , ' values' ],
60+ ' untyped_array' => varray [' test' , ' values' ],
5961 ]);
6062 $validator -> validate();
6163
0 commit comments