public function Abstract2Dot5ApiTest::testReferenceMetadataMustImplementClassMetadataInterface in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/validator/Tests/Validator/Abstract2Dot5ApiTest.php \Symfony\Component\Validator\Tests\Validator\Abstract2Dot5ApiTest::testReferenceMetadataMustImplementClassMetadataInterface()
@expectedException \Symfony\Component\Validator\Exception\UnsupportedMetadataException @group legacy
File
- vendor/
symfony/ validator/ Tests/ Validator/ Abstract2Dot5ApiTest.php, line 567
Class
- Abstract2Dot5ApiTest
- Verifies that a validator satisfies the API of Symfony 2.5+.
Namespace
Symfony\Component\Validator\Tests\ValidatorCode
public function testReferenceMetadataMustImplementClassMetadataInterface() {
$entity = new Entity();
$entity->reference = new Reference();
$metadata = $this
->getMock('Symfony\\Component\\Validator\\Tests\\Fixtures\\LegacyClassMetadata');
$metadata
->expects($this
->any())
->method('getClassName')
->will($this
->returnValue(get_class($entity->reference)));
$this->metadataFactory
->addMetadata($metadata);
$this->metadata
->addPropertyConstraint('reference', new Valid());
$this->validator
->validate($entity);
}