8000 [Serializer] ObjectNormalizer: test normalize with a non-existing group · symfony/symfony@e2eba98 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2eba98

Browse files
committed
[Serializer] ObjectNormalizer: test normalize with a non-existing group
1 parent f44185f commit e2eba98

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,10 +241,14 @@ public function testGroupsDenormalize()
241241

242242
public function testNormalizeNoPropertyInGroup()
243243
{
244+
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
245+
$this->normalizer = new ObjectNormalizer($classMetadataFactory);
246+
$this->normalizer->setSerializer($this->serializer);
247+
244248
$obj = new GroupDummy();
245249
$obj->setFoo('foo');
246250

247-
var_dump($this->normalizer->normalize($obj, array('groups' => ['notExist'])));
251+
$this->assertEquals(array(), $this->normalizer->normalize($obj, null, array('groups' => array('notExist'))));
248252
}
249253

250254
public function testGroupsNormalizeWithNameConverter()

0 commit comments

Comments
 (0)
0