16
16
use Doctrine \Common \Persistence \ObjectManager ;
17
17
use Doctrine \Common \Persistence \ObjectRepository ;
18
18
use Symfony \Bridge \Doctrine \Test \DoctrineTestHelper ;
19
- use Symfony \Bridge \Doctrine \Tests \Fixtures \CompositeIntIdEntity ;
20
19
use Symfony \Component \Validator \Tests \Constraints \AbstractConstraintValidatorTest ;
21
20
use Symfony \Bridge \Doctrine \Tests \Fixtures \SingleIntIdEntity ;
22
21
use Symfony \Bridge \Doctrine \Tests \Fixtures \DoubleNameEntity ;
@@ -398,7 +397,7 @@ public function testAssociatedEntity()
398
397
399
398
$ this ->buildViolation ('myMessage ' )
400
399
->atPath ('property.path.single ' )
401
- ->setInvalidValue (1 )
400
+ ->setInvalidValue ($ entity1 )
402
401
->assertRaised ();
403
402
}
404
403
@@ -422,29 +421,6 @@ public function testAssociatedEntityWithNull()
422
421
$ this ->assertNoViolation ();
423
422
}
424
423
425
- /**
426
- * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
427
- * @expectedExceptionMessage Associated entities are not allowed to have more than one identifier field
428
- */
429
- public function testAssociatedCompositeEntity ()
430
- {
431
- $ constraint = new UniqueEntity (array (
432
- 'message ' => 'myMessage ' ,
433
- 'fields ' => array ('composite ' ),
434
- 'em ' => self ::EM_NAME ,
435
- ));
436
-
437
- $ composite = new CompositeIntIdEntity (1 , 1 , 'test ' );
438
- $ associated = new AssociationEntity ();
439
- $ associated ->composite = $ composite ;
440
-
441
- $ this ->em ->persist ($ composite );
442
- $ this ->em ->persist ($ associated );
443
- $ this ->em ->flush ();
444
-
445
- $ this ->validator ->validate ($ associated , $ constraint );
446
- }
447
-
448
424
/**
449
425
* @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
450
426
* @expectedExceptionMessage Object manager "foo" does not exist.
0 commit comments