Skip to content

Commit

Permalink
Test for plain arrays are not touched on normalizing
Browse files Browse the repository at this point in the history
  • Loading branch information
scaytrase authored and Pavel Batanov committed Sep 9, 2016
1 parent bab8c48 commit 4fad547
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests/JMS/Serializer/Tests/Serializer/ArrayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
namespace JMS\Serializer\Tests\Serializer;

use JMS\Serializer\Handler\HandlerRegistry;
use JMS\Serializer\SerializationContext;
use JMS\Serializer\Tests\Fixtures\Author;
use JMS\Serializer\Tests\Fixtures\AuthorList;
use JMS\Serializer\Tests\Fixtures\Order;
Expand Down Expand Up @@ -120,4 +121,12 @@ public function testToArrayConversNestedArrayObjects()
$result = $this->serializer->toArray($list);
$this->assertSame(array('authors' => array(array())), $result);
}
}

public function testNullArraySerialization()
{
$context = SerializationContext::create();
$context->setSerializeNull(true);
$array = [0, null, 'a'];
$this->assertSame($array, $this->serializer->toArray($array, $context));
}
}

0 comments on commit 4fad547

Please sign in to comment.