You are here

public function Abstract2Dot5ApiTest::testMetadataMustImplementClassMetadataInterface in Plug 7

@expectedException \Symfony\Component\Validator\Exception\UnsupportedMetadataException

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Validator/Abstract2Dot5ApiTest.php, line 600

Class

Abstract2Dot5ApiTest
Verifies that a validator satisfies the API of Symfony 2.5+.

Namespace

Symfony\Component\Validator\Tests\Validator

Code

public function testMetadataMustImplementClassMetadataInterface() {
  $entity = new Entity();
  $metadata = $this
    ->getMock('Symfony\\Component\\Validator\\Tests\\Fixtures\\LegacyClassMetadata');
  $metadata
    ->expects($this
    ->any())
    ->method('getClassName')
    ->will($this
    ->returnValue(get_class($entity)));
  $this->metadataFactory
    ->addMetadata($metadata);
  $this->validator
    ->validate($entity);
}