@@ -124,9 +124,9 @@ public function testMapToVirtualFormIfDataDoesNotMatch()
124
124
125
125
$ this ->mapper ->mapViolation ($ violation , $ parent );
126
126
127
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
127
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
128
128
$ this ->assertEquals (array ($ this ->getFormError ()), $ child ->getErrors (), $ child ->getName () . ' should have an error, but has none ' );
129
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
129
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
130
130
}
131
131
132
132
public function testFollowDotRules ()
@@ -149,9 +149,9 @@ public function testFollowDotRules()
149
149
150
150
$ this ->mapper ->mapViolation ($ violation , $ parent );
151
151
152
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
153
- $ this ->assertFalse ( $ child ->hasErrors (), $ child ->getName () . ' should not have an error, but has one ' );
154
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
152
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
153
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ child ->getName () . ' should not have an error, but has one ' );
154
+ $ this ->assertCount ( 0 , $ grandChild ->getErr
F438
ors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
155
155
$ this ->assertEquals (array ($ this ->getFormError ()), $ grandGrandChild ->getErrors (), $ grandGrandChild ->getName () . ' should have an error, but has none ' );
156
156
}
157
157
@@ -172,9 +172,9 @@ public function testAbortMappingIfNotSynchronized()
172
172
173
173
$ this ->mapper ->mapViolation ($ violation , $ parent );
174
174
175
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
176
- $ this ->assertFalse ( $ child ->hasErrors (), $ child ->getName () . ' should not have an error, but has one ' );
177
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
175
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
176
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ child ->getName () . ' should not have an error, but has one ' );
177
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
178
178
}
179
179
180
180
public function testAbortVirtualFormMappingIfNotSynchronized ()
@@ -194,9 +194,9 @@ public function testAbortVirtualFormMappingIfNotSynchronized()
194
194
195
195
$ this ->mapper ->mapViolation ($ violation , $ parent );
196
196
197
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
198
- $ this ->assertFalse ( $ child ->hasErrors (), $ child ->getName () . ' should not have an error, but has one ' );
199
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
197
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
198
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ child ->getName () . ' should not have an error, but has one ' );
199
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
200
200
}
201
201
202
202
public function testAbortDotRuleMappingIfNotSynchronized ()
@@ -218,9 +218,9 @@ public function testAbortDotRuleMappingIfNotSynchronized()
218
218
219
219
$ this ->mapper ->mapViolation ($ violation , $ parent );
220
220
221
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
222
- $ this ->assertFalse ( $ child ->hasErrors (), $ child ->getName () . ' should not have an error, but has one ' );
223
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
221
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
222
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ child ->getName () . ' should not have an error, but has one ' );
223
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChild ->getName () . ' should not have an error, but has one ' );
224
224
}
225
225
226
226
public function provideDefaultTests ()
@@ -732,15 +732,15 @@ public function testDefaultErrorMapping($target, $childName, $childPath, $grandC
732
732
733
733
if (self ::LEVEL_0 === $ target ) {
734
734
$ this ->assertEquals (array ($ this ->getFormError ()), $ parent ->getErrors (), $ parent ->getName () . ' should have an error, but has none ' );
735
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
736
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
735
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
736
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
737
737
} elseif (self ::LEVEL_1 === $ target ) {
738
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
738
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
739
739
$ this ->assertEquals (array ($ this ->getFormError ()), $ child ->getErrors (), $ childName . ' should have an error, but has none ' );
740
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
740
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
741
741
} else {
742
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
743
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
742
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
743
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
744
744
$ this ->assertEquals (array ($ this ->getFormError ()), $ grandChild ->getErrors (), $ grandChildName . ' should have an error, but has none ' );
745
745
}
746
746
}
@@ -1199,20 +1199,20 @@ public function testCustomDataErrorMapping($target, $mapFrom, $mapTo, $childName
1199
1199
$ this ->mapper ->mapViolation ($ violation , $ parent );
1200
1200
1201
1201
if ($ target !== self ::LEVEL_0 ) {
1202
- $ this ->assertFalse ( $ distraction ->hasErrors (), 'distraction should not have an error, but has one ' );
1202
+ $ this ->assertCount ( 0 , $ distraction ->getErrors (), 'distraction should not have an error, but has one ' );
1203
1203
}
1204
1204
1205
1205
if (self ::LEVEL_0 === $ target ) {
1206
1206
$ this ->assertEquals (array ($ this ->getFormError ()), $ parent ->getErrors (), $ parent ->getName () . ' should have an error, but has none ' );
1207
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
1208
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
1207
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
1208
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
1209
1209
} elseif (self ::LEVEL_1 === $ target ) {
1210
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1210
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1211
1211
$ this ->assertEquals (array ($ this ->getFormError ()), $ child ->getErrors (), $ childName . ' should have an error, but has none ' );
1212
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
1212
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
1213
1213
} else {
1214
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1215
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
1214
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1215
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
1216
1216
$ this ->assertEquals (array ($ this ->getFormError ()), $ grandChild ->getErrors (), $ grandChildName . ' should have an error, but has none ' );
1217
1217
}
1218
1218
}
@@ -1385,24 +1385,24 @@ public function testCustomFormErrorMapping($target, $mapFrom, $mapTo, $errorName
1385
1385
$ this ->mapper ->mapViolation ($ violation , $ parent );
1386
1386
1387
1387
if (self ::LEVEL_0 === $ target ) {
1388
- $ this ->assertFalse ( $ errorChild ->hasErrors (), $ errorName . ' should not have an error, but has one ' );
1388
+ $ this ->assertCount ( 0 , $ errorChild ->getErrors (), $ errorName . ' should not have an error, but has one ' );
1389
1389
$ this ->assertEquals (array ($ this ->getFormError ()), $ parent ->getErrors (), $ parent ->getName () . ' should have an error, but has none ' );
1390
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
1391
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
1390
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
1391
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
1392
1392
} elseif (self ::LEVEL_1 === $ target ) {
1393
- $ this ->assertFalse ( $ errorChild ->hasErrors (), $ errorName . ' should not have an error, but has one ' );
1394
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1393
+ $ this ->assertCount ( 0 , $ errorChild ->getErrors (), $ errorName . ' should not have an error, but has one ' );
1394
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1395
1395
$ this ->assertEquals (array ($ this ->getFormError ()), $ child ->getErrors (), $ childName . ' should have an error, but has none ' );
1396
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
1396
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
1397
1397
} elseif (self ::LEVEL_1B === $ target ) {
1398
1398
$ this ->assertEquals (array ($ this ->getFormError ()), $ errorChild ->getErrors (), $ errorName . ' should have an error, but has none ' );
1399
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1400
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, bu
F438
t has one ' );
1401
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
1399
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1400
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
1401
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
1402
1402
} else {
1403
- $ this ->assertFalse ( $ errorChild ->hasErrors (), $ errorName . ' should not have an error, but has one ' );
1404
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1405
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
1403
+ $ this ->assertCount ( 0 , $ errorChild ->getErrors (), $ errorName . ' should not have an error, but has one ' );
1404
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1405
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
1406
1406
$ this ->assertEquals (array ($ this ->getFormError ()), $ grandChild ->getErrors (), $ grandChildName . ' should have an error, but has none ' );
1407
1407
}
1408
1408
}
@@ -1449,15 +1449,15 @@ public function testVirtualFormErrorMapping($target, $childName, $childPath, $gr
1449
1449
1450
1450
if (self ::LEVEL_0 === $ target ) {
1451
1451
$ this ->assertEquals (array ($ this ->getFormError ()), $ parent ->getErrors (), $ parent ->getName () . ' should have an error, but has none ' );
1452
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
1453
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
1452
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
1453
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
1454
1454
} elseif (self ::LEVEL_1 === $ target ) {
1455
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1455
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1456
1456
$ this ->assertEquals (array ($ this ->getFormError ()), $ child ->getErrors (), $ childName . ' should have an error, but has none ' );
1457
- $ this ->assertFalse ( $ grandChild ->hasErrors (), $ grandChildName . ' should not have an error, but has one ' );
1457
+ $ this ->assertCount ( 0 , $ grandChild ->getErrors (), $ grandChildName . ' should not have an error, but has one ' );
1458
1458
} else {
1459
- $ this ->assertFalse ( $ parent ->hasErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1460
- $ this ->assertFalse ( $ child ->hasErrors (), $ childName . ' should not have an error, but has one ' );
1459
+ $ this ->assertCount ( 0 , $ parent ->getErrors (), $ parent ->getName () . ' should not have an error, but has one ' );
1460
+ $ this ->assertCount ( 0 , $ child ->getErrors (), $ childName . ' should not have an error, but has one ' );
1461
1461
$ this ->assertEquals (array ($ this ->getFormError ()), $ grandChild ->getErrors (), $ grandChildName . ' should have an error, but has none ' );
1462
1462
}
1463
1463
}
0 commit comments