You are here

public function SerializerTest::testEncode 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::testEncode()

File

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

Class

SerializerTest

Namespace

Symfony\Component\Serializer\Tests

Code

public function testEncode() {
  $this->serializer = new Serializer(array(), array(
    'json' => new JsonEncoder(),
  ));
  $data = array(
    'foo',
    array(
      5,
      3,
    ),
  );
  $result = $this->serializer
    ->encode($data, 'json');
  $this
    ->assertEquals(json_encode($data), $result);
}