minor #18836 [Serializer] Add test for ignored attributes during denormalization (dunglas)
This PR was merged into the 2.7 branch.
Discussion
----------
[Serializer] Add test for ignored attributes during denormalization
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Commits
-------
c2f7fed
[Serializer] Add test for ignored attributes during denormalization
This commit is contained in:
commit
d8341421af
@ -324,6 +324,19 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testIgnoredAttributesDenormalize()
|
||||
{
|
||||
$this->normalizer->setIgnoredAttributes(array('fooBar', 'bar', 'baz'));
|
||||
|
||||
$obj = new ObjectDummy();
|
||||
$obj->setFoo('foo');
|
||||
|
||||
$this->assertEquals(
|
||||
$obj,
|
||||
$this->normalizer->denormalize(array('fooBar' => 'fooBar', 'foo' => 'foo', 'baz' => 'baz'), __NAMESPACE__.'\ObjectDummy')
|
||||
);
|
||||
}
|
||||
|
||||
public function provideCallbacks()
|
||||
{
|
||||
return array(
|
||||
|
Reference in New Issue
Block a user