You are here

public function GetSetMethodNormalizerTest::testNormalize in Zircon Profile 8

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

File

vendor/symfony/serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php, line 50

Class

GetSetMethodNormalizerTest

Namespace

Symfony\Component\Serializer\Tests\Normalizer

Code

public function testNormalize() {
  $obj = new GetSetDummy();
  $object = new \stdClass();
  $obj
    ->setFoo('foo');
  $obj
    ->setBar('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'));
}