- /**
- * @group legacy
- */
- public function testLegacyCamelizedAttributesNormalize()
- {
- $obj = new GetCamelizedDummy('dunglas.fr');
- $obj->setFooBar('les-tilleuls.coop');
- $obj->setBar_foo('lostinthesupermarket.fr');
-
- $this->normalizer->setCamelizedAttributes(array('kevin_dunglas'));
- $this->assertEquals($this->normalizer->normalize($obj), array(
- 'kevin_dunglas' => 'dunglas.fr',
- 'fooBar' => 'les-tilleuls.coop',
- 'bar_foo' => 'lostinthesupermarket.fr',
- ));
-
- $this->normalizer->setCamelizedAttributes(array('foo_bar'));
- $this->assertEquals($this->normalizer->normalize($obj), array(
- 'kevinDunglas' => 'dunglas.fr',
- 'foo_bar' => 'les-tilleuls.coop',
- 'bar_foo' => 'lostinthesupermarket.fr',
- ));
- }
-
- /**
- * @group legacy
- */
- public function testLegacyCamelizedAttributesDenormalize()
- {
- $obj = new GetCamelizedDummy('dunglas.fr');
- $obj->setFooBar('les-tilleuls.coop');
- $obj->setBar_foo('lostinthesupermarket.fr');
-
- $this->normalizer->setCamelizedAttributes(array('kevin_dunglas'));
- $this->assertEquals($this->normalizer->denormalize(array(
- 'kevin_dunglas' => 'dunglas.fr',
- 'fooBar' => 'les-tilleuls.coop',
- 'bar_foo' => 'lostinthesupermarket.fr',
- ), __NAMESPACE__.'\GetCamelizedDummy'), $obj);
-
- $this->normalizer->setCamelizedAttributes(array('foo_bar'));
- $this->assertEquals($this->normalizer->denormalize(array(
- 'kevinDunglas' => 'dunglas.fr',
- 'foo_bar' => 'les-tilleuls.coop',
- 'bar_foo' => 'lostinthesupermarket.fr',
- ), __NAMESPACE__.'\GetCamelizedDummy'), $obj);
- }
-