$this->metadata =
new TestMemberMetadata( Entity::
class,
'getLastName',
'lastName'
);
} public function testAddConstraintRequiresClassConstraints() { $this->
expectException(ConstraintDefinitionException::
class);
$this->metadata->
addConstraint(new ClassConstraint());
} public function testAddCompositeConstraintRejectsNestedClassConstraints() { $this->
expectException(ConstraintDefinitionException::
class);
$this->
expectExceptionMessage('The constraint "Symfony\Component\Validator\Tests\Fixtures\ClassConstraint" cannot be put on properties or getters.'
);
$this->metadata->
addConstraint(new PropertyCompositeConstraint([new ClassConstraint()]));
} public function testAddCompositeConstraintRejectsDeepNestedClassConstraints() {