8000 minor #18836 [Serializer] Add test for ignored attributes during deno… · symfony/symfony@d834142 · GitHub
[go: up one dir, main page]

Skip to content

Commit d834142

Browse files
committed
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
2 parents 95bb8bb + c2f7fed commit d834142

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