Symfony\Component\Serializer\Tests\Normalizer\ObjectNormalizerTest::testGroupsNormalizeWithNameConverter PHP Method

testGroupsNormalizeWithNameConverter() public method

    public function testGroupsNormalizeWithNameConverter()
    {
        $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
        $this->normalizer = new ObjectNormalizer($classMetadataFactory, new CamelCaseToSnakeCaseNameConverter());
        $this->normalizer->setSerializer($this->serializer);
        $obj = new GroupDummy();
        $obj->setFooBar('@dunglas');
        $obj->setSymfony('@coopTilleuls');
        $obj->setCoopTilleuls('les-tilleuls.coop');
        $this->assertEquals(array('bar' => null, 'foo_bar' => '@dunglas', 'symfony' => '@coopTilleuls'), $this->normalizer->normalize($obj, null, array(ObjectNormalizer::GROUPS => array('name_converter'))));
    }