You are here

public function PropertyNormalizerTest::testLegacyCamelizedAttributesNormalize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php \Symfony\Component\Serializer\Tests\Normalizer\PropertyNormalizerTest::testLegacyCamelizedAttributesNormalize()

@group legacy

File

vendor/symfony/serializer/Tests/Normalizer/PropertyNormalizerTest.php, line 82

Class

PropertyNormalizerTest

Namespace

Symfony\Component\Serializer\Tests\Normalizer

Code

public function testLegacyCamelizedAttributesNormalize() {
  $obj = new PropertyCamelizedDummy('dunglas.fr');
  $obj->fooBar = 'les-tilleuls.coop';
  $obj->bar_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',
  ));
}