public function ClassMetadataTest::testAddMultiplePropertyConstraints in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/validator/Tests/Mapping/ClassMetadataTest.php \Symfony\Component\Validator\Tests\Mapping\ClassMetadataTest::testAddMultiplePropertyConstraints()
File
- vendor/
symfony/ validator/ Tests/ Mapping/ ClassMetadataTest.php, line 61
Class
Namespace
Symfony\Component\Validator\Tests\MappingCode
public function testAddMultiplePropertyConstraints() {
$this->metadata
->addPropertyConstraints('lastName', array(
new ConstraintA(),
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('lastName', $properties[0]
->getName());
$this
->assertEquals($constraints, $properties[0]
->getConstraints());
}