8000 [Serializer] Add test for ignored attributes during denormalization · symfony/symfony@c2f7fed · GitHub
[go: up one dir, main page]

Skip to content

Commit c2f7fed

Browse files
committed
[Serializer] Add test for ignored attributes during denormalization
1 parent 95bb8bb commit c2f7fed

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/Symfony/Component/Serializer/Tests/Normalizer/ObjectNormalizerTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,19 @@ public function testIgnoredAttributes()
324324
);
325325
}
326326

327+
public function testIgnoredAttributesDenormalize()
328+
{
329+
$this->normalizer->setIgnoredAttributes(array('fooBar', 'bar', 'baz'));
330+
331+
$obj = new ObjectDummy();
332+
$obj->setFoo('foo');
333+
334+
$this->assertEquals(
335+
$obj,
336+
$this->normalizer->denormalize(array('fooBar' => 'fooBar', 'foo' => 'foo', 'baz' => 'baz'), __NAMESPACE__.'\ObjectDummy')
337+
);
338+
}
339+
327340
public function provideCallbacks()
328341
{
329342
return array(

0 commit comments

Comments
 (0)
0