You are here

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

File

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

Class

SerializerTest

Namespace

Symfony\Component\Serializer\Tests

Code

public function testCustomNormalizerCanNormalizeCollectionsAndScalar() {
  $this->serializer = new Serializer(array(
    new TestNormalizer(),
  ), array());
  $this
    ->assertNull($this->serializer
    ->normalize(array(
    'a',
    'b',
  )));
  $this
    ->assertNull($this->serializer
    ->normalize(new \ArrayObject(array(
    'c',
    'd',
  ))));
  $this
    ->assertNull($this->serializer
    ->normalize(array()));
  $this
    ->assertNull($this->serializer
    ->normalize('test'));
}