public function ClassMetadataTest::testMergeConstraintsMergesClassConstraints in Plug 7
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Mapping/ ClassMetadataTest.php, line 110
Class
Namespace
Symfony\Component\Validator\Tests\MappingCode
public function testMergeConstraintsMergesClassConstraints() {
$parent = new ClassMetadata(self::PARENTCLASS);
$parent
->addConstraint(new ConstraintA());
$this->metadata
->mergeConstraints($parent);
$this->metadata
->addConstraint(new ConstraintA());
$constraints = array(
new ConstraintA(array(
'groups' => array(
'Default',
'EntityParent',
'Entity',
),
)),
new ConstraintA(array(
'groups' => array(
'Default',
'Entity',
),
)),
);
$this
->assertEquals($constraints, $this->metadata
->getConstraints());
}