You are here

public function AttributeMetadataTest::testMerge in Zircon Profile 8

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

File

vendor/symfony/serializer/Tests/Mapping/AttributeMetadataTest.php, line 43

Class

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

Namespace

Symfony\Component\Serializer\Tests\Mapping

Code

public function testMerge() {
  $attributeMetadata1 = new AttributeMetadata('a1');
  $attributeMetadata1
    ->addGroup('a');
  $attributeMetadata1
    ->addGroup('b');
  $attributeMetadata2 = new AttributeMetadata('a2');
  $attributeMetadata2
    ->addGroup('a');
  $attributeMetadata2
    ->addGroup('c');
  $attributeMetadata1
    ->merge($attributeMetadata2);
  $this
    ->assertEquals(array(
    'a',
    'b',
    'c',
  ), $attributeMetadata1
    ->getGroups());
}