[Serializer] Silent deprecation notice

This commit is contained in:
Kévin Dunglas 2015-02-04 21:45:48 +01:00
parent 9c32972787
commit 8135843b70
2 changed files with 18 additions and 6 deletions

View File

@ -93,8 +93,10 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('bar', $obj->getBar());
}
public function testDenormalizeOnCamelCaseFormat()
public function testLegacyDenormalizeOnCamelCaseFormat()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->normalizer->setCamelizedAttributes(array('camel_case'));
$obj = $this->normalizer->denormalize(
array('camel_case' => 'camelCase'),
@ -109,8 +111,10 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(new GetSetDummy(), $this->normalizer->denormalize(null, __NAMESPACE__.'\GetSetDummy'));
}
public function testCamelizedAttributesNormalize()
public function testLegacyCamelizedAttributesNormalize()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$obj = new GetCamelizedDummy('dunglas.fr');
$obj->setFooBar('les-tilleuls.coop');
$obj->setBar_foo('lostinthesupermarket.fr');
@ -130,8 +134,10 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
));
}
public function testCamelizedAttributesDenormalize()
public function testLegacyCamelizedAttributesDenormalize()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$obj = new GetCamelizedDummy('dunglas.fr');
$obj->setFooBar('les-tilleuls.coop');
$obj->setBar_foo('lostinthesupermarket.fr');

View File

@ -62,8 +62,10 @@ class PropertyNormalizerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('bar', $obj->getBar());
}
public function testDenormalizeOnCamelCaseFormat()
public function testLegacyDenormalizeOnCamelCaseFormat()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$this->normalizer->setCamelizedAttributes(array('camel_case'));
$obj = $this->normalizer->denormalize(
array('camel_case' => 'value'),
@ -72,8 +74,10 @@ class PropertyNormalizerTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('value', $obj->getCamelCase());
}
public function testCamelizedAttributesNormalize()
public function testLegacyCamelizedAttributesNormalize()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$obj = new PropertyCamelizedDummy('dunglas.fr');
$obj->fooBar = 'les-tilleuls.coop';
$obj->bar_foo = 'lostinthesupermarket.fr';
@ -93,8 +97,10 @@ class PropertyNormalizerTest extends \PHPUnit_Framework_TestCase
));
}
public function testCamelizedAttributesDenormalize()
public function testLegacyCamelizedAttributesDenormalize()
{
$this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED);
$obj = new PropertyCamelizedDummy('dunglas.fr');
$obj->fooBar = 'les-tilleuls.coop';
$obj->bar_foo = 'lostinthesupermarket.fr';