You are here

public function SerializerTest::testNormalizeGivesPriorityToInterfaceOverTraversable in Zircon Profile 8

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

File

vendor/symfony/serializer/Tests/SerializerTest.php, line 52

Class

SerializerTest

Namespace

Symfony\Component\Serializer\Tests

Code

public function testNormalizeGivesPriorityToInterfaceOverTraversable() {
  $this->serializer = new Serializer(array(
    new CustomNormalizer(),
  ), array(
    'json' => new JsonEncoder(),
  ));
  $result = $this->serializer
    ->serialize(new NormalizableTraversableDummy(), 'json');
  $this
    ->assertEquals('{"foo":"normalizedFoo","bar":"normalizedBar"}', $result);
}