You are here

public function ClassMetadataTest::testAttributeMetadata in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php \Symfony\Component\Serializer\Tests\Mapping\ClassMetadataTest::testAttributeMetadata()

File

vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php, line 27

Class

ClassMetadataTest
@author Kévin Dunglas <dunglas@gmail.com>

Namespace

Symfony\Component\Serializer\Tests\Mapping

Code

public function testAttributeMetadata() {
  $classMetadata = new ClassMetadata('c');
  $a1 = $this
    ->getMock('Symfony\\Component\\Serializer\\Mapping\\AttributeMetadataInterface');
  $a1
    ->method('getName')
    ->willReturn('a1');
  $a2 = $this
    ->getMock('Symfony\\Component\\Serializer\\Mapping\\AttributeMetadataInterface');
  $a2
    ->method('getName')
    ->willReturn('a2');
  $classMetadata
    ->addAttributeMetadata($a1);
  $classMetadata
    ->addAttributeMetadata($a2);
  $this
    ->assertEquals(array(
    'a1' => $a1,
    'a2' => $a2,
  ), $classMetadata
    ->getAttributesMetadata());
}