@@ -17,30 +17,146 @@ class ArraySubsetTest extends ConstraintTestCase
17
17
public static function evaluateDataProvider ()
18
18
{
19
19
return [
20
- 'loose array subset and array other ' => [
20
+ 'loose associative array subset and array other ' => [
21
21
'expected ' => true ,
22
22
'subset ' => ['bar ' => 0 ],
23
23
'other ' => ['foo ' => '' , 'bar ' => '0 ' ],
24
24
'strict ' => false
25
25
],
26
- 'strict array subset and array other ' => [
26
+ 'strict associative array subset and array other ' => [
27
27
'expected ' => false ,
28
28
'subset ' => ['bar ' => 0 ],
29
29
'other ' => ['foo ' => '' , 'bar ' => '0 ' ],
30
30
'strict ' => true
31
31
],
32
- 'loose array subset and ArrayObject other ' => [
32
+ 'loose associative array subset and ArrayObject other ' => [
33
33
'expected ' => true ,
34
34
'subset ' => ['bar ' => 0 ],
35
35
'other ' => new \ArrayObject (['foo ' => '' , 'bar ' => '0 ' ]),
36
36
'strict ' => false
37
37
],
38
- 'strict ArrayObject subset and array other ' => [
38
+ 'strict associative ArrayObject subset and array other ' => [
39
39
'expected ' => true ,
40
40
'subset ' => new \ArrayObject (['bar ' => 0 ]),
41
41
'other ' => ['foo ' => '' , 'bar ' => 0 ],
42
42
'strict ' => true
43
43
],
44
+ 'loose indexed array subset and array other ' => [
45
+ 'expected ' => true ,
46
+ 'subset ' => [0 ],
47
+ 'other ' => ['' , '0 ' ],
48
+ 'strict ' => false
49
+ ],
50
+ 'strict indexed array subset and array other ' => [
51
+ 'expected ' => false ,
52
+ 'subset ' => [0 ],
53
+ 'other ' => ['' , '0 ' ],
54
+ 'strict ' => true
55
+ ],
56
+ 'loose indexed array subset and ArrayObject other ' => [
57
+ 'expected ' => true ,
58
+ 'subset ' => [0 ],
59
+ 'other ' => new \ArrayObject (['' , '0 ' ]),
60
+ 'strict ' => false
61
+ ],
62
+ 'strict indexed ArrayObject subset and array other ' => [
63
+ 'expected ' => true ,
64
+ 'subset ' => new \ArrayObject ([0 ]),
65
+ 'other ' => ['' , 0 ],
66
+ 'strict ' => true
67
+ ],
68
+ 'loose unordered indexed array subset and array other ' => [
69
+ 'expected ' => true ,
70
+ 'subset ' => [0 , '1 ' ],
71
+ 'other ' => ['1 ' , '2 ' , '0 ' ],
72
+ 'strict ' => false
73
+ ],
74
+ 'strict unordered indexed array subset and array other ' => [
75
+ 'expected ' => false ,
76
+ 'subset ' => [0 , '1 ' ],
77
+ 'other ' => ['1 ' , '2 ' , '0 ' ],
78
+ 'strict ' => true
79
+ ],
80
+ 'loose unordered indexed array subset and ArrayObject other ' => [
81
+ 'expected ' => true ,
82
+ 'subset ' => [0 , '1 ' ],
83
+ 'other ' => new \ArrayObject (['1 ' , '2 ' , '0 ' ]),
84
+ 'strict ' => false
85
+ ],
86
+ 'strict unordered indexed ArrayObject subset and array other ' => [
87
+ 'expected ' => true ,
88
+ 'subset ' => new \ArrayObject ([0 , '1 ' ]),
89
+ 'other ' => ['1 ' , '2 ' , 0 ],
90
+ 'strict ' => true
91
+ ],
92
+ 'loose unordered multidimensional indexed array subset and array other ' => [
93
+ 'expected ' => true ,
94
+ 'subset ' => [
95
+ [[3 , 4 ], 2 ],
96
+ '10 ' ,
97
+ ],
98
+ 'other ' => [
99
+ 0 => '1 ' ,
100
+ 'a ' => [
101
+ 'aa ' => '2 ' ,
102
+ 'ab ' => [5 , 4 , 3 ],
103
+ 'ac ' => 10 ,
104
+ ],
105
+ 'b ' => '10 ' ,
106
+ ],
107
+ 'strict ' => false
108
+ ],
109
+ 'strict unordered multidimensional indexed array subset and array other ' => [
110
+ 'expected ' => false ,
111
+ 'subset ' => [
112
+ [[3 , 4 ], 2 ],
113
+ '10 ' ,
114
+ ],
115
+ 'other ' => [
116
+ 0 => '1 ' ,
117
+ 'a ' => [
118
+ 'aa ' => '2 ' ,
119
+ 'ab ' => [5 , 4 , 3 ],
120
+ 'ac ' => 10 ,
121
+ ],
122
+ 'b ' => '10 ' ,
123
+ ],
124
+ 'strict ' => true
125
+ ],
126
+ 'loose unordered multidimensional indexed array subset and ArrayObject other ' => [
127
+ 'expected ' => true ,
128
+ 'subset ' => [
129
+ [[3 , 4 ], 2 ],
130
+ '10 ' ,
131
+ ],
132
+ 'other ' => new \ArrayObject ([
133
+ 0 => '1 ' ,
134
+ 'a ' => [
135
+ 'aa ' => '2 ' ,
136
+ 'ab ' => [5 , 4 , 3 ],
137
+ 'ac ' => 10 ,
138
+ ],
139
+ 'b ' => '10 ' ,
140
+ ]),
141
+ 'strict ' => false
142
+ ],
143
+ 'strict unordered multidimensional indexed ArrayObject subset and array other ' => [
144
+ 'expected ' => true ,
145
+ 'subset ' => new \ArrayObject ([
146
+ [[3 , 4 ], '2 ' ],
147
+ '10 ' ,
148
+ ]),
149
+ 'other ' => [
150
+ 0 => '1 ' ,
151
+ 'a ' => [
152
+ 'aa ' => '2 ' ,
153
+ 'ab ' => [5 , 4 , 3 ],
154
+ 'ac ' => 10 ,
155
+ ],
156
+ 'b ' => '10 ' ,
157
+ ],
158
+ 'strict ' => true
159
+ ],
44
160
];
45
161
}
46
162
0 commit comments