You are here

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

File

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

Class

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

Namespace

Symfony\Component\Serializer\Tests\Normalizer

Code

public function testIgnoredAttributes() {
  $this->normalizer
    ->setIgnoredAttributes(array(
    'foo',
    'bar',
    'baz',
    'camelCase',
    'object',
  ));
  $obj = new ObjectDummy();
  $obj
    ->setFoo('foo');
  $obj->bar = 'bar';
  $obj
    ->setBaz(true);
  $this
    ->assertEquals(array(
    'fooBar' => 'foobar',
  ), $this->normalizer
    ->normalize($obj, 'any'));
}