You are here

public function ObjectNormalizerTest::testConstructorDenormalizeWithMissingOptionalArgument in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Tests/Normalizer/ObjectNormalizerTest.php \Symfony\Component\Serializer\Tests\Normalizer\ObjectNormalizerTest::testConstructorDenormalizeWithMissingOptionalArgument()

File

vendor/symfony/serializer/Tests/Normalizer/ObjectNormalizerTest.php, line 148

Class

ObjectNormalizerTest
@author Kévin Dunglas <dunglas@gmail.com>

Namespace

Symfony\Component\Serializer\Tests\Normalizer

Code

public function testConstructorDenormalizeWithMissingOptionalArgument() {
  $obj = $this->normalizer
    ->denormalize(array(
    'foo' => 'test',
    'baz' => array(
      1,
      2,
      3,
    ),
  ), __NAMESPACE__ . '\\ObjectConstructorOptionalArgsDummy', 'any');
  $this
    ->assertEquals('test', $obj
    ->getFoo());
  $this
    ->assertEquals(array(), $obj->bar);
  $this
    ->assertEquals(array(
    1,
    2,
    3,
  ), $obj
    ->getBaz());
}