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:
Fabien Potencier 2016-05-23 10:44:03 +02:00
commit d8341421af

View File

@ -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(