We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68fd013 commit ee50f4dCopy full SHA for ee50f4d
tests/Unit/Schema/AssocSchemaTest.php
@@ -133,6 +133,19 @@ public function testParseSuccessWithJsonSerialzableObject(): void
133
self::assertSame((array) $input, $output);
134
}
135
136
+ public function testParseSuccessWithNumberAtTheBeginningOfTheString(): void
137
+ {
138
+ $input = ['1field' => 'test', '2field' => 1];
139
+
140
+ $schema = new AssocSchema(['1field' => new StringSchema(), '2field' => new IntSchema()]);
141
142
+ $output = $schema->parse([...$input, 'field3' => 1.5]);
143
144
+ self::assertIsArray($output);
145
146
+ self::assertSame($input, $output);
147
+ }
148
149
public function testParseSuccessWithOptional(): void
150
{
151
$input = ['field2' => 'test', 'field3' => null];
0 commit comments