public function SerializerTest::testNormalizeTraversable

File

drupal/core/vendor/symfony/serializer/Symfony/Component/Serializer/Tests/SerializerTest.php, line 34

Class

SerializerTest

Namespace

Symfony\Component\Serializer\Tests

Code

public function testNormalizeTraversable() {
  $this->serializer = new Serializer(array(), array(
    'json' => new JsonEncoder(),
  ));
  $result = $this->serializer
    ->serialize(new TraversableDummy(), 'json');
  $this
    ->assertEquals('{"foo":"foo","bar":"bar"}', $result);
}