@@ -276,7 +276,7 @@ public function testValidation()
276
276
277
277
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
278
278
279
- $ this ->assertCount (7 , $ calls );
279
+ $ this ->assertCount (6 , $ calls );
280
280
$ this ->assertSame ('setConstraintValidatorFactory ' , $ calls [0 ][0 ]);
281
281
$ this ->assertEquals (array (new Reference ('validator.validator_factory ' )), $ calls [0 ][1 ]);
282
282
$ this ->assertSame ('setTranslator ' , $ calls [1 ][0 ]);
@@ -289,8 +289,6 @@ public function testValidation()
289
289
$ this ->assertSame (array ('loadValidatorMetadata ' ), $ calls [4 ][1 ]);
290
290
$ this ->assertSame ('setMetadataCache ' , $ calls [5 ][0 ]);
291
291
$ this ->assertEquals (array (new Reference ('validator.mapping.cache.apc ' )), $ calls [5 ][1 ]);
292
- $ this ->assertSame ('setApiVersion ' , $ calls [6 ][0 ]);
293
- $ this ->assertEquals (array (Validation::API_VERSION_2_5_BC ), $ calls [6 ][1 ]);
294
292
}
295
293
296
294
/**
@@ -306,14 +304,14 @@ public function testLegacyFullyConfiguredValidationService()
306
304
307
305
$ container = $ this ->createContainerFromFile ('full ' );
308
306
309
- $ this ->assertInstanceOf ('Symfony\Component\Validator\ValidatorInterface ' , $ container ->get ('validator ' ));
307
+ $ this ->assertInstanceOf ('Symfony\Component\Validator\Validator\ ValidatorInterface ' , $ container ->get ('validator ' ));
310
308
}
311
309
312
310
public function testValidationService ()
313
311
{
314
312
$ container = $ this ->createContainerFromFile ('validation_annotations ' );
315
313
316
- $ this ->assertInstanceOf ('Symfony\Component\Validator\ValidatorInterface ' , $ container ->get ('validator ' ));
314
+ $ this ->assertInstanceOf ('Symfony\Component\Validator\Validator\ ValidatorInterface ' , $ container ->get ('validator ' ));
317
315
}
318
316
319
317
public function testAnnotations ()
@@ -337,7 +335,7 @@ public function testValidationAnnotations()
337
335
338
336
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
339
337
340
- $ this ->assertCount (7 , $ calls );
338
+ $ this ->assertCount (6 , $ calls );
341
339
$ this ->assertSame ('enableAnnotationMapping ' , $ calls [4 ][0 ]);
342
340
$ this ->assertEquals (array (new Reference ('annotation_reader ' )), $ calls [4 ][1 ]);
343
341
$ this ->assertSame ('addMethodMapping ' , $ calls [5 ][0 ]);
@@ -355,7 +353,7 @@ public function testValidationPaths()
355
353
356
354
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
357
355
358
- $ this ->assertCount (8 , $ calls );
356
+ $ this ->assertCount (7 , $ calls );
359
357
$ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
360
358
$ this ->assertSame ('addYamlMappings ' , $ calls [4 ][0 ]);
361
359
$ this ->assertSame ('enableAnnotationMapping ' , $ calls [5 ][0 ]);
@@ -378,79 +376,11 @@ public function testValidationNoStaticMethod()
378
376
379
377
$ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
380
378
381
- $ this ->assertCount (5 , $ calls );
379
+ $ this ->assertCount (4 , $ calls );
382
380
$ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
383
381
// no cache, no annotations, no static methods
384
382
}
385
383
386
- public function testValidation2Dot5Api ()
387
- {
388
- $ container = $ this ->createContainerFromFile ('validation_2_5_api ' );
389
-
390
- $ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
391
-
392
- $ this ->assertCount (6 , $ calls );
393
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
394
- $ this ->assertSame ('addMethodMapping ' , $ calls [4 ][0 ]);
395
- $ this ->assertSame (array ('loadValidatorMetadata ' ), $ calls [4 ][1 ]);
396
- $ this ->assertSame ('setApiVersion ' , $ calls [5 ][0 ]);
397
- $ this ->assertSame (array (Validation::API_VERSION_2_5 ), $ calls [5 ][1 ]);
398
- $ this ->assertSame ('Symfony\Component\Validator\Validator\ValidatorInterface ' , $ container ->getParameter ('validator.class ' ));
399
- // no cache, no annotations
400
- }
401
-
402
- public function testValidation2Dot5BcApi ()
403
- {
404
- $ container = $ this ->createContainerFromFile ('validation_2_5_bc_api ' );
405
-
406
- $ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
407
-
408
- $ this ->assertCount (6 , $ calls );
409
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
410
- $ this ->assertSame ('addMethodMapping ' , $ calls [4 ][0 ]);
411
- $ this ->assertSame (array ('loadValidatorMetadata ' ), $ calls [4 ][1 ]);
412
- $ this ->assertSame ('setApiVersion ' , $ calls [5 ][0 ]);
413
- $ this ->assertSame (array (Validation::API_VERSION_2_5_BC ), $ calls [5 ][1 ]);
414
- $ this ->assertSame ('Symfony\Component\Validator\ValidatorInterface ' , $ container ->getParameter ('validator.class ' ));
415
- // no cache, no annotations
416
- }
417
-
418
- public function testValidationImplicitApi ()
419
- {
420
- $ container = $ this ->createContainerFromFile ('validation_implicit_api ' );
421
-
422
- $ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
423
-
424
- $ this ->assertCount (6 , $ calls );
425
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
426
- $ this ->assertSame ('addMethodMapping ' , $ calls [4 ][0 ]);
427
- $ this ->assertSame (array ('loadValidatorMetadata ' ), $ calls [4 ][1 ]);
428
- $ this ->assertSame ('setApiVersion ' , $ calls [5 ][0 ]);
429
- // no cache, no annotations
430
-
431
- $ this ->assertSame (array (Validation::API_VERSION_2_5_BC ), $ calls [5 ][1 ]);
432
- }
433
-
434
- /**
435
- * This feature is equivalent to the implicit api, only that the "api"
436
- * key is explicitly set to "auto".
437
- */
438
- public function testValidationAutoApi ()
439
- {
440
- $ container = $ this ->createContainerFromFile ('validation_auto_api ' );
441
-
442
- $ calls = $ container ->getDefinition ('validator.builder ' )->getMethodCalls ();
443
-
444
- $ this ->assertCount (6 , $ calls );
445
- $ this ->assertSame ('addXmlMappings ' , $ calls [3 ][0 ]);
446
- $ this ->assertSame ('addMethodMapping ' , $ calls [4 ][0 ]);
447
- $ this ->assertSame (array ('loadValidatorMetadata ' ), $ calls [4 ][1 ]);
448
- $ this ->assertSame ('setApiVersion ' , $ calls [5 ][0 ]);
449
- // no cache, no annotations
450
-
451
- $ this ->assertSame (array (Validation::API_VERSION_2_5_BC ), $ calls [5 ][1 ]);
452
- }
453
-
454
384
public function testFormsCanBeEnabledWithoutCsrfProtection ()
455
385
{
456
386
$ container = $ this ->createContainerFromFile ('form_no_csrf ' );
0 commit comments