Skip to content

Commit

Permalink
test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel BORGES committed Mar 7, 2019
1 parent 52cfeb3 commit c16690e
Showing 1 changed file with 20 additions and 0 deletions.
Expand Up @@ -329,6 +329,26 @@ public function testLegacyUncallableCallbacks()
$this->doTestUncallableCallbacks(true);
}

public function testIgnoredAttributesInContext()
{
$ignoredAttributes = ['foo', 'bar', 'baz', 'object'];
$this->createNormalizer([GetSetMethodNormalizer::IGNORED_ATTRIBUTES => $ignoredAttributes]);

$obj = new GetSetDummy();
$obj->setFoo('foo');
$obj->setBar('bar');
$obj->setCamelCase(true);

$this->assertEquals(
[
'fooBar' => 'foobar',
'camelCase' => true
],
$this->normalizer->normalize($obj, 'any')
);
}


private function doTestUncallableCallbacks(bool $legacy = false)
{
$callbacks = ['bar' => null];
Expand Down

0 comments on commit c16690e

Please sign in to comment.