|
12 | 12 |
|
13 | 13 | namespace Respect\Validation\Test; |
14 | 14 |
|
| 15 | +use ArrayAccess; |
| 16 | +use ArrayObject; |
15 | 17 | use PHPUnit\Framework\TestCase as PHPUnitTestCase; |
16 | 18 | use Respect\Validation\Test\Stubs\WithProperties; |
17 | 19 | use Respect\Validation\Test\Stubs\WithStaticProperties; |
@@ -194,21 +196,23 @@ public static function providerForNonResourceType(): DataProvider |
194 | 196 | return self::providerForAnyValues()->without('resourceType'); |
195 | 197 | } |
196 | 198 |
|
197 | | - /** @return array<string, array{string|int, array<mixed>}> */ |
| 199 | + /** @return array<string, array{string|int, array<mixed>|ArrayAccess<int, mixed>}> */ |
198 | 200 | public static function providerForArrayWithMissingKeys(): array |
199 | 201 | { |
200 | 202 | return [ |
| 203 | + 'missing key on an ArrayAccess object' => [1, new ArrayObject([])], |
201 | 204 | 'integer key, non-empty input' => [0, [1 => true, 2 => true]], |
202 | 205 | 'string key, non-empty input' => ['foo', ['bar' => true, 'baz' => true]], |
203 | 206 | 'integer key, empty input' => [0, []], |
204 | 207 | 'string key, empty input' => ['foo', []], |
205 | 208 | ]; |
206 | 209 | } |
207 | 210 |
|
208 | | - /** @return array<string, array{string|int, array<mixed>}> */ |
| 211 | + /** @return array<string, array{string|int, array<mixed>|ArrayAccess<int, mixed>}> */ |
209 | 212 | public static function providerForArrayWithExistingKeys(): array |
210 | 213 | { |
211 | 214 | return [ |
| 215 | + 'key on an ArrayAccess object' => [1, new ArrayObject([1 => true])], |
212 | 216 | 'integer key with a single value array' => [1, [1 => true]], |
213 | 217 | 'integer key with a multiple value array' => [2, [1 => true, 2 => true]], |
214 | 218 | 'string key with a single value array' => ['foo', ['foo' => true, 'bar' => true]], |
|
0 commit comments