@@ -1193,16 +1193,18 @@ public function testValidation()
1193
1193
1194
1194
$ annotations = !class_exists (FullStack::class);
1195
1195
1196
- $ this ->assertCount ($ annotations ? 7 : 6 , $ calls );
1196
+ $ this ->assertCount ($ annotations ? 8 : 7 , $ calls );
1197
1197
$ this ->assertSame ('setConstraintValidatorFactory ' , $ calls [0 ][0 ]);
1198
1198
$ this ->assertEquals ([new Reference ('validator.validator_factory ' )], $ calls [0 ][1 ]);
1199
- $ this ->assertSame ('setTranslator ' , $ calls [1 ][0 ]);
1200
- $ this ->assertEquals ([new Reference ('translator ' , ContainerBuilder::IGNORE_ON_INVALID_REFERENCE )], $ calls [1 ][1 ]);
1201
- $ this ->assertSame ('setTranslationDomain ' , $ calls [2 ][0 ]);
1202
- $ this ->assertSame (['%validator.translation_domain% ' ], $ calls [2 ][1 ]);
1203
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
1204
- $ this ->assertSame ([$ xmlMappings ], $ calls [3 ][1 ]);
1205
- $ i = 3 ;
1199
+ $ this ->assertSame ('setGroupProviderLocator ' , $ calls [1 ][0 ]);
1200
+ $ this ->assertInstanceOf (ServiceLocatorArgument::class, $ calls [1 ][1 ][0 ]);
1201
+ $ this ->assertSame ('setTranslator ' , $ calls [2 ][0 ]);
1202
+ $ this ->assertEquals ([new Reference ('translator ' , ContainerBuilder::IGNORE_ON_INVALID_REFERENCE )], $ calls [2 ][1 ]);
1203
+ $ this ->assertSame ('setTranslationDomain ' , $ calls [3 ][0 ]);
1204
+ $ this ->assertSame (['%validator.translation_domain% ' ], $ calls [3 ][1 ]);
1205
+ $ this ->assertSame ('addXmlMappings ' , $ calls [4 ][0 ]);
1206
+ $ this ->assertSame ([$ xmlMappings ], $ calls [4 ][1 ]);
1207
+ $ i = 4 ;
1206
1208
if ($ annotations ) {
1207
1209
$ this ->assertSame ('enableAttributeMapping ' , $ calls [++$ i ][0 ]);
1208
1210
}
@@ -1248,12 +1250,12 @@ public function testValidationAttributes()
1248
1250
1249
1251
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
1250
1252
1251
- $ this ->assertCount (7 , $ calls );
1252
- $ this ->assertSame ('enableAttributeMapping ' , $ calls [4 ][0 ]);
1253
- $ this ->assertSame ('addMethodMapping ' , $ calls [5 ][0 ]);
1254
- $ this ->assertSame (['loadValidatorMetadata ' ], $ calls [5 ][1 ]);
1255
- $ this ->assertSame ('setMappingCache ' , $ calls [6 ][0 ]);
1256
- $ this ->assertEquals ([new Reference ('validator.mapping.cache.adapter ' )], $ calls [6 ][1 ]);
1253
+ $ this ->assertCount (8 , $ calls );
1254
+ $ this ->assertSame ('enableAttributeMapping ' , $ calls [5 ][0 ]);
1255
+ $ this ->assertSame ('addMethodMapping ' , $ calls [6 ][0 ]);
1256
+ $ this ->assertSame (['loadValidatorMetadata ' ], $ calls [6 ][1 ]);
1257
+ $ this ->assertSame ('setMappingCache ' , $ calls [7 ][0 ]);
1258
+ $ this ->assertEquals ([new Reference ('validator.mapping.cache.adapter ' )], $ calls [7 ][1 ]);
1257
1259
// no cache this time
1258
1260
}
1259
1261
@@ -1268,16 +1270,16 @@ public function testValidationPaths()
1268
1270
1269
1271
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
1270
1272
1271
- $ this ->assertCount (8 , $ calls );
1272
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
1273
- $ this ->assertSame ('addYamlMappings ' , $ calls [4 ][0 ]);
1274
- $ this ->assertSame ('enableAttributeMapping ' , $ calls [5 ][0 ]);
1275
- $ this ->assertSame ('addMethodMapping ' , $ calls [6 ][0 ]);
1276
- $ this ->assertSame (['loadValidatorMetadata ' ], $ calls [6 ][1 ]);
1277
- $ this ->assertSame ('setMappingCache ' , $ calls [7 ][0 ]);
1278
- $ this ->assertEquals ([new Reference ('validator.mapping.cache.adapter ' )], $ calls [7 ][1 ]);
1273
+ $ this ->assertCount (9 , $ calls );
1274
+ $ this ->assertSame ('addXmlMappings ' , $ calls [4 ][0 ]);
1275
+ $ this ->assertSame ('addYamlMappings ' , $ calls [5 ][0 ]);
1276
+ $ this ->assertSame ('enableAttributeMapping ' , $ calls [6 ][0 ]);
1277
+ $ this ->assertSame ('addMethodMapping ' , $ calls [7 ][0 ]);
1278
+ $ this ->assertSame (['loadValidatorMetadata ' ], $ calls [7 ][1 ]);
1279
+ $ this ->assertSame ('setMappingCache ' , $ calls [8 ][0 ]);
1280
+ $ this ->assertEquals ([new Reference ('validator.mapping.cache.adapter ' )], $ calls [8 ][1 ]);
1279
1281
1280
- $ xmlMappings = $ calls [3 ][1 ][0 ];
1282
+ $ xmlMappings = $ calls [4 ][1 ][0 ];
1281
1283
$ this ->assertCount (3 , $ xmlMappings );
1282
1284
try {
1283
1285
// Testing symfony/symfony
@@ -1288,7 +1290,7 @@ public function testValidationPaths()
1288
1290
}
1289
1291
$ this ->assertStringEndsWith ('TestBundle/Resources/config/validation.xml ' , $ xmlMappings [1 ]);
1290
1292
1291
- $ yamlMappings = $ calls [4 ][1 ][0 ];
1293
+ $ yamlMappings = $ calls [5 ][1 ][0 ];
1292
1294
$ this ->assertCount (1 , $ yamlMappings );
1293
1295
$ this ->assertStringEndsWith ('TestBundle/Resources/config/validation.yml ' , $ yamlMappings [0 ]);
1294
1296
}
@@ -1303,7 +1305,7 @@ public function testValidationPathsUsingCustomBundlePath()
1303
1305
]);
1304
1306
1305
1307
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
1306
- $ xmlMappings = $ calls [3 ][1 ][0 ];
1308
+ $ xmlMappings = $ calls [4 ][1 ][0 ];
1307
1309
$ this ->assertCount (3 , $ xmlMappings );
1308
1310
1309
1311
try {
@@ -1315,7 +1317,7 @@ public function testValidationPathsUsingCustomBundlePath()
1315
1317
}
1316
1318
$ this ->assertStringEndsWith ('CustomPathBundle/Resources/config/validation.xml ' , $ xmlMappings [1 ]);
1317
1319
1318
- $ yamlMappings = $ calls [4 ][1 ][0 ];
1320
+ $ yamlMappings = $ calls [5 ][1 ][0 ];
1319
1321
$ this ->assertCount (1 , $ yamlMappings );
1320
1322
$ this ->assertStringEndsWith ('CustomPathBundle/Resources/config/validation.yml ' , $ yamlMappings [0 ]);
1321
1323
}
@@ -1328,9 +1330,9 @@ public function testValidationNoStaticMethod()
1328
1330
1329
1331
$ annotations = !class_exists (FullStack::class);
1330
1332
1331
- $ this ->assertCount ($ annotations ? 6 : 5 , $ calls );
1332
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
1333
- $ i = 3 ;
1333
+ $ this ->assertCount ($ annotations ? 7 : 6 , $ calls );
1334
+ $ this ->assertSame ('addXmlMappings ' , $ calls [4 ][0 ]);
1335
+ $ i = 4 ;
1334
1336
if ($ annotations ) {
1335
1337
$ this ->assertSame ('enableAttributeMapping ' , $ calls [++$ i ][0 ]);
1336
1338
}
@@ -1359,14 +1361,14 @@ public function testValidationMapping()
1359
1361
1360
1362
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
1361
1363
1362
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
1363
- $ this ->assertCount (3 , $ calls [3 ][1 ][0 ]);
1364
-
1365
- $ this ->assertSame ('addYamlMappings ' , $ calls [4 ][0 ]);
1364
+ $ this ->assertSame ('addXmlMappings ' , $ calls [4 ][0 ]);
1366
1365
$ this ->assertCount (3 , $ calls [4 ][1 ][0 ]);
1367
- $ this ->assertStringContainsString ('foo.yml ' , $ calls [4 ][1 ][0 ][0 ]);
1368
- $ this ->assertStringContainsString ('validation.yml ' , $ calls [4 ][1 ][0 ][1 ]);
1369
- $ this ->assertStringContainsString ('validation.yaml ' , $ calls [4 ][1 ][0 ][2 ]);
1366
+
1367
+ $ this ->assertSame ('addYamlMappings ' , $ calls [5 ][0 ]);
1368
+ $ this ->assertCount (3 , $ calls [5 ][1 ][0 ]);
1369
+ $ this ->assertStringContainsString ('foo.yml ' , $ calls [5 ][1 ][0 ][0 ]);
1370
+ $ this ->assertStringContainsString ('validation.yml ' , $ calls [5 ][1 ][0 ][1 ]);
1371
+ $ this ->assertStringContainsString ('validation.yaml ' , $ calls [5 ][1 ][0 ][2 ]);
1370
1372
}
1371
1373
1372
1374
public function testValidationAutoMapping ()
0 commit comments