public function GetSetMethodNormalizerTest::testCircularReferenceHandler in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php \Symfony\Component\Serializer\Tests\Normalizer\GetSetMethodNormalizerTest::testCircularReferenceHandler()
File
- vendor/
symfony/ serializer/ Tests/ Normalizer/ GetSetMethodNormalizerTest.php, line 511
Class
Namespace
Symfony\Component\Serializer\Tests\NormalizerCode
public function testCircularReferenceHandler() {
$serializer = new Serializer(array(
$this->normalizer,
));
$this->normalizer
->setSerializer($serializer);
$this->normalizer
->setCircularReferenceHandler(function ($obj) {
return get_class($obj);
});
$obj = new CircularReferenceDummy();
$expected = array(
'me' => 'Symfony\\Component\\Serializer\\Tests\\Fixtures\\CircularReferenceDummy',
);
$this
->assertEquals($expected, $this->normalizer
->normalize($obj));
}