Skip to content

Commit f771423

Browse files
Revert "Test ArraySubset with indexed arrays."
This reverts commit 9b263ed.
1 parent 2be8695 commit f771423

File tree

2 files changed

+5
-157
lines changed

2 files changed

+5
-157
lines changed

tests/Framework/AssertTest.php

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,13 @@ public function testAssertArraySubset(): void
158158
'd' => ['a2' => ['a3' => 'item a3', 'b3' => 'item b3']]
159159
];
160160

161-
$this->assertArraySubset(['a' => 'item a'], $array);
162161
$this->assertArraySubset(['a' => 'item a', 'c' => ['a2' => 'item a2']], $array);
163162
$this->assertArraySubset(['a' => 'item a', 'd' => ['a2' => ['b3' => 'item b3']]], $array);
164-
$this->assertArraySubset(['b' => 'item b', 'd' => ['a2' => ['b3' => 'item b3']]], $array);
165163

166164
$arrayAccessData = new \ArrayObject($array);
167165

168-
$this->assertArraySubset(['a' => 'item a'], $arrayAccessData);
169166
$this->assertArraySubset(['a' => 'item a', 'c' => ['a2' => 'item a2']], $arrayAccessData);
170167
$this->assertArraySubset(['a' => 'item a', 'd' => ['a2' => ['b3' => 'item b3']]], $arrayAccessData);
171-
$this->assertArraySubset(['b' => 'item b', 'd' => ['a2' => ['b3' => 'item b3']]], $arrayAccessData);
172168

173169
try {
174170
$this->assertArraySubset(['a' => 'bad value'], $array);
@@ -184,39 +180,6 @@ public function testAssertArraySubset(): void
184180
$this->fail();
185181
}
186182

187-
public function testAssertArraySubsetWithIndexedArrays(): void
188-
{
189-
$array = [
190-
'item a',
191-
'item b',
192-
['a2' => 'item a2', 'b2' => 'item b2'],
193-
['a2' => ['a3' => 'item a3', 'b3' => 'item b3']]
194-
];
195-
196-
$this->assertArraySubset(['item a', ['a2' => 'item a2']], $array);
197-
$this->assertArraySubset(['item a', ['a2' => ['b3' => 'item b3']]], $array);
198-
$this->assertArraySubset(['item b', ['a2' => ['b3' => 'item b3']]], $array);
199-
200-
$arrayAccessData = new \ArrayObject($array);
201-
202-
$this->assertArraySubset(['item a', ['a2' => 'item a2']], $arrayAccessData);
203-
$this->assertArraySubset(['item a', ['a2' => ['b3' => 'item b3']]], $arrayAccessData);
204-
$this->assertArraySubset(['item b', ['a2' => ['b3' => 'item b3']]], $arrayAccessData);
205-
206-
try {
207-
$this->assertArraySubset(['bad value'], $array);
208-
} catch (AssertionFailedError $e) {
209-
}
210-
211-
try {
212-
$this->assertArraySubset([['a2' => ['bad index' => 'item b3']]], $array);
213-
} catch (AssertionFailedError $e) {
214-
return;
215-
}
216-
217-
$this->fail();
218-
}
219-
220183
public function testAssertArraySubsetWithDeepNestedArrays(): void
221184
{
222185
$array = [

tests/Framework/Constraint/ArraySubsetTest.php

Lines changed: 5 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -16,146 +16,30 @@ class ArraySubsetTest extends ConstraintTestCase
1616
public static function evaluateDataProvider()
1717
{
1818
return [
19-
'loose associative array subset and array other' => [
19+
'loose array subset and array other' => [
2020
'expected' => true,
2121
'subset' => ['bar' => 0],
2222
'other' => ['foo' => '', 'bar' => '0'],
2323
'strict' => false
2424
],
25-
'strict associative array subset and array other' => [
25+
'strict array subset and array other' => [
2626
'expected' => false,
2727
'subset' => ['bar' => 0],
2828
'other' => ['foo' => '', 'bar' => '0'],
2929
'strict' => true
3030
],
31-
'loose associative array subset and ArrayObject other' => [
31+
'loose array subset and ArrayObject other' => [
3232
'expected' => true,
3333
'subset' => ['bar' => 0],
3434
'other' => new \ArrayObject(['foo' => '', 'bar' => '0']),
3535
'strict' => false
3636
],
37-
'strict associative ArrayObject subset and array other' => [
37+
'strict ArrayObject subset and array other' => [
3838
'expected' => true,
3939
'subset' => new \ArrayObject(['bar' => 0]),
4040
'other' => ['foo' => '', 'bar' => 0],
4141
'strict' => true
4242
],
43-
'loose indexed array subset and array other' => [
44-
'expected' => true,
45-
'subset' => [0],
46-
'other' => ['', '0'],
47-
'strict' => false
48-
],
49-
'strict indexed array subset and array other' => [
50-
'expected' => false,
51-
'subset' => [0],
52-
'other' => ['', '0'],
53-
'strict' => true
54-
],
55-
'loose indexed array subset and ArrayObject other' => [
56-
'expected' => true,
57-
'subset' => [0],
58-
'other' => new \ArrayObject(['', '0']),
59-
'strict' => false
60-
],
61-
'strict indexed ArrayObject subset and array other' => [
62-
'expected' => true,
63-
'subset' => new \ArrayObject([0]),
64-
'other' => ['', 0],
65-
'strict' => true
66-
],
67-
'loose unordered indexed array subset and array other' => [
68-
'expected' => true,
69-
'subset' => [0, '1'],
70-
'other' => ['1', '2', '0'],
71-
'strict' => false
72-
],
73-
'strict unordered indexed array subset and array other' => [
74-
'expected' => false,
75-
'subset' => [0, '1'],
76-
'other' => ['1', '2', '0'],
77-
'strict' => true
78-
],
79-
'loose unordered indexed array subset and ArrayObject other' => [
80-
'expected' => true,
81-
'subset' => [0, '1'],
82-
'other' => new \ArrayObject(['1', '2', '0']),
83-
'strict' => false
84-
],
85-
'strict unordered indexed ArrayObject subset and array other' => [
86-
'expected' => true,
87-
'subset' => new \ArrayObject([0, '1']),
88-
'other' => ['1', '2', 0],
89-
'strict' => true
90-
],
91-
'loose unordered multidimensional indexed array subset and array other' => [
92-
'expected' => true,
93-
'subset' => [
94-
[[3, 4], 2],
95-
'10',
96-
],
97-
'other' => [
98-
0 => '1',
99-
'a' => [
100-
'aa' => '2',
101-
'ab' => [5, 4, 3],
102-
'ac' => 10,
103-
],
104-
'b' => '10',
105-
],
106-
'strict' => false
107-
],
108-
'strict unordered multidimensional indexed array subset and array other' => [
109-
'expected' => false,
110-
'subset' => [
111-
[[3, 4], 2],
112-
'10',
113-
],
114-
'other' => [
115-
0 => '1',
116-
'a' => [
117-
'aa' => '2',
118-
'ab' => [5, 4, 3],
119-
'ac' => 10,
120-
],
121-
'b' => '10',
122-
],
123-
'strict' => true
124-
],
125-
'loose unordered multidimensional indexed array subset and ArrayObject other' => [
126-
'expected' => true,
127-
'subset' => [
128-
[[3, 4], 2],
129-
'10',
130-
],
131-
'other' => new \ArrayObject([
132-
0 => '1',
133-
'a' => [
134-
'aa' => '2',
135-
'ab' => [5, 4, 3],
136-
'ac' => 10,
137-
],
138-
'b' => '10',
139-
]),
140-
'strict' => false
141-
],
142-
'strict unordered multidimensional indexed ArrayObject subset and array other' => [
143-
'expected' => true,
144-
'subset' => new \ArrayObject([
145-
[[3, 4], '2'],
146-
'10',
147-
]),
148-
'other' => [
149-
0 => '1',
150-
'a' => [
151-
'aa' => '2',
152-
'ab' => [5, 4, 3],
153-
'ac' => 10,
154-
],
155-
'b' => '10',
156-
],
157-
'strict' => true
158-
],
15943
];
16044
}
16145

@@ -200,3 +84,4 @@ public function testEvaluateFailMessage(): void
20084
}
20185
}
20286
}
87+

0 commit comments

Comments
 (0)