You are here

public function SerializerTest::testDeserializeUseCache in Zircon Profile 8.0

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

File

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

Class

SerializerTest

Namespace

Symfony\Component\Serializer\Tests

Code

public function testDeserializeUseCache() {
  $this->serializer = new Serializer(array(
    new GetSetMethodNormalizer(),
  ), array(
    'json' => new JsonEncoder(),
  ));
  $data = array(
    'title' => 'foo',
    'numbers' => array(
      5,
      3,
    ),
  );
  $this->serializer
    ->deserialize(json_encode($data), '\\Symfony\\Component\\Serializer\\Tests\\Model', 'json');
  $data = array(
    'title' => 'bar',
    'numbers' => array(
      2,
      8,
    ),
  );
  $result = $this->serializer
    ->deserialize(json_encode($data), '\\Symfony\\Component\\Serializer\\Tests\\Model', 'json');
  $this
    ->assertEquals($data, $result
    ->toArray());
}