You are here

public function ObjectNormalizerTest::testNormalize 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::testNormalize()

File

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

Class

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

Namespace

Symfony\Component\Serializer\Tests\Normalizer

Code

public function testNormalize() {
  $obj = new ObjectDummy();
  $object = new \stdClass();
  $obj
    ->setFoo('foo');
  $obj->bar = 'bar';
  $obj
    ->setBaz(true);
  $obj
    ->setCamelCase('camelcase');
  $obj
    ->setObject($object);
  $this->serializer
    ->expects($this
    ->once())
    ->method('normalize')
    ->with($object, 'any')
    ->will($this
    ->returnValue('string_object'));
  $this
    ->assertEquals(array(
    'foo' => 'foo',
    'bar' => 'bar',
    'baz' => true,
    'fooBar' => 'foobar',
    'camelCase' => 'camelcase',
    'object' => 'string_object',
  ), $this->normalizer
    ->normalize($obj, 'any'));
}