public function testAddConstraintDoesNotAcceptValid() { $this->
expectException(ConstraintDefinitionException::
class);
$this->metadata->
addConstraint(new Valid());
} public function testAddConstraintRequiresClassConstraints() { $this->
expectException(ConstraintDefinitionException::
class);
$this->metadata->
addConstraint(new PropertyConstraint());
} public function testAddCompositeConstraintRejectsNestedPropertyConstraints() { $this->
expectException(ConstraintDefinitionException::
class);
$this->
expectExceptionMessage('The constraint "Symfony\Component\Validator\Tests\Fixtures\PropertyConstraint" cannot be put on classes.'
);
$this->metadata->
addConstraint(new ClassCompositeConstraint([new PropertyConstraint()]));
} public function testAddCompositeConstraintAcceptsNestedClassConstraints() {