1616use Doctrine \Common \Persistence \ObjectManager ;
1717use Doctrine \Common \Persistence \ObjectRepository ;
1818use Symfony \Bridge \Doctrine \Test \DoctrineTestHelper ;
19- use Symfony \Bridge \Doctrine \Tests \Fixtures \CompositeIntIdEntity ;
2019use Symfony \Component \Validator \Tests \Constraints \AbstractConstraintValidatorTest ;
2120use Symfony \Bridge \Doctrine \Tests \Fixtures \SingleIntIdEntity ;
2221use Symfony \Bridge \Doctrine \Tests \Fixtures \DoubleNameEntity ;
@@ -398,7 +397,7 @@ public function testAssociatedEntity()
398397
399398 $ this ->buildViolation ('myMessage ' )
400399 ->atPath ('property.path.single ' )
401- ->setInvalidValue (1 )
400+ ->setInvalidValue ($ entity1 )
402401 ->assertRaised ();
403402 }
404403
@@ -422,29 +421,6 @@ public function testAssociatedEntityWithNull()
422421 $ this ->assertNoViolation ();
423422 }
424423
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-
448424 /**
449425 * @expectedException \Symfony\Component\Validator\Exception\ConstraintDefinitionException
450426 * @expectedExceptionMessage Object manager "foo" does not exist.
0 commit comments