public function ClassMetadataTest::testAddGetterConstraints in Plug 7
File
- lib/
Symfony/ validator/ Symfony/ Component/ Validator/ Tests/ Mapping/ ClassMetadataTest.php, line 77
Class
Namespace
Symfony\Component\Validator\Tests\MappingCode
public function testAddGetterConstraints() {
$this->metadata
->addGetterConstraint('lastName', new ConstraintA());
$this->metadata
->addGetterConstraint('lastName', new ConstraintB());
$constraints = array(
new ConstraintA(array(
'groups' => array(
'Default',
'Entity',
),
)),
new ConstraintB(array(
'groups' => array(
'Default',
'Entity',
),
)),
);
$properties = $this->metadata
->getPropertyMetadata('lastName');
$this
->assertCount(1, $properties);
$this
->assertEquals('getLastName', $properties[0]
->getName());
$this
->assertEquals($constraints, $properties[0]
->getConstraints());
}