public function ClassMetadataTest::testSerialize in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/validator/Tests/Mapping/ClassMetadataTest.php \Symfony\Component\Validator\Tests\Mapping\ClassMetadataTest::testSerialize()
- 8 vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php \Symfony\Component\Serializer\Tests\Mapping\ClassMetadataTest::testSerialize()
Same name and namespace in other branches
- 8.0 vendor/symfony/serializer/Tests/Mapping/ClassMetadataTest.php \Symfony\Component\Serializer\Tests\Mapping\ClassMetadataTest::testSerialize()
File
- vendor/
symfony/ serializer/ Tests/ Mapping/ ClassMetadataTest.php, line 66
Class
- ClassMetadataTest
- @author Kévin Dunglas <dunglas@gmail.com>
Namespace
Symfony\Component\Serializer\Tests\MappingCode
public function testSerialize() {
$classMetadata = new ClassMetadata('a');
$a1 = $this
->getMock('Symfony\\Component\\Serializer\\Mapping\\AttributeMetadataInterface');
$a1
->method('getName')
->willReturn('b1');
$a2 = $this
->getMock('Symfony\\Component\\Serializer\\Mapping\\AttributeMetadataInterface');
$a2
->method('getName')
->willReturn('b2');
$classMetadata
->addAttributeMetadata($a1);
$classMetadata
->addAttributeMetadata($a2);
$serialized = serialize($classMetadata);
$this
->assertEquals($classMetadata, unserialize($serialized));
}