[Serializer] Add test for ignored attributes during denormalization
This commit is contained in:
parent
95bb8bb6c8
commit
c2f7fedfd6
@ -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()
|
public function provideCallbacks()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
|
Reference in New Issue
Block a user