Update to Drupal 8.0.0 beta 14. For more information, see https://drupal.org/node/2544542
This commit is contained in:
parent
3b2511d96d
commit
81ccda77eb
2155 changed files with 54307 additions and 46870 deletions
3
core/vendor/symfony/serializer/.gitignore
vendored
Normal file
3
core/vendor/symfony/serializer/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
vendor/
|
||||
composer.lock
|
||||
phpunit.xml
|
|
@ -30,21 +30,22 @@ class Groups
|
|||
|
||||
/**
|
||||
* @param array $data
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(array $data)
|
||||
{
|
||||
if (!isset($data['value']) || !$data['value']) {
|
||||
throw new InvalidArgumentException(sprintf("Parameter of annotation '%s' cannot be empty.", get_class($this)));
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" cannot be empty.', get_class($this)));
|
||||
}
|
||||
|
||||
if (!is_array($data['value'])) {
|
||||
throw new InvalidArgumentException(sprintf("Parameter of annotation '%s' must be an array of strings.", get_class($this)));
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be an array of strings.', get_class($this)));
|
||||
}
|
||||
|
||||
foreach ($data['value'] as $group) {
|
||||
if (!is_string($group)) {
|
||||
throw new InvalidArgumentException(sprintf("Parameter of annotation '%s' must be an array of strings.", get_class($this)));
|
||||
throw new InvalidArgumentException(sprintf('Parameter of annotation "%s" must be an array of strings.', get_class($this)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +53,7 @@ class Groups
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets groups
|
||||
* Gets groups.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -62,7 +62,7 @@ class JsonDecode implements DecoderInterface
|
|||
*/
|
||||
public function getLastError()
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->lastError;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class JsonEncode implements EncoderInterface
|
|||
*/
|
||||
public function getLastError()
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->lastError;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class JsonEncoder implements EncoderInterface, DecoderInterface
|
|||
*/
|
||||
public function getLastEncodingError()
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonEncode::encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonEncode::encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->encodingImpl->getLastError();
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class JsonEncoder implements EncoderInterface, DecoderInterface
|
|||
*/
|
||||
public function getLastDecodingError()
|
||||
{
|
||||
trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonDecode::decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED);
|
||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonDecode::decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED);
|
||||
|
||||
return $this->decodingImpl->getLastError();
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ class ClassMetadata implements ClassMetadataInterface
|
|||
{
|
||||
return array(
|
||||
'name',
|
||||
'attributes',
|
||||
'attributesMetadata',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,7 +153,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
|
|||
*/
|
||||
public function setCamelizedAttributes(array $camelizedAttributes)
|
||||
{
|
||||
trigger_error(sprintf('%s is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('%s is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
|
||||
if ($this->nameConverter && !$this->nameConverter instanceof CamelCaseToSnakeCaseNameConverter) {
|
||||
throw new LogicException(sprintf('%s cannot be called if a custom Name Converter is defined.', __METHOD__));
|
||||
|
@ -232,7 +232,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
|
|||
*/
|
||||
protected function formatAttribute($attributeName)
|
||||
{
|
||||
trigger_error(sprintf('%s is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
@trigger_error(sprintf('%s is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Serializer\NameConverter\CamelCaseToSnakeCaseNameConverter instead.', __METHOD__), E_USER_DEPRECATED);
|
||||
|
||||
return $this->nameConverter ? $this->nameConverter->normalize($attributeName) : $attributeName;
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ abstract class AbstractNormalizer extends SerializerAwareNormalizer implements N
|
|||
}
|
||||
|
||||
/**
|
||||
* Instantiates an object using contructor parameters when needed.
|
||||
* Instantiates an object using constructor parameters when needed.
|
||||
*
|
||||
* This method also allows to denormalize data into an existing object if
|
||||
* it is present in the context with the object_to_populate key.
|
||||
|
|
|
@ -19,7 +19,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
|
|||
class GroupsTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function testEmptyGroupsParameter()
|
||||
{
|
||||
|
@ -27,7 +27,7 @@ class GroupsTest extends \PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function testNotAnArrayGroupsParameter()
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ class GroupsTest extends \PHPUnit_Framework_TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @expectedException \InvalidArgumentException
|
||||
* @expectedException \Symfony\Component\Serializer\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function testInvalidGroupsParameter()
|
||||
{
|
||||
|
|
|
@ -54,4 +54,14 @@ class AttributeMetadataTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->assertEquals(array('a', 'b', 'c'), $attributeMetadata1->getGroups());
|
||||
}
|
||||
|
||||
public function testSerialize()
|
||||
{
|
||||
$attributeMetadata = new AttributeMetadata('attribute');
|
||||
$attributeMetadata->addGroup('a');
|
||||
$attributeMetadata->addGroup('b');
|
||||
|
||||
$serialized = serialize($attributeMetadata);
|
||||
$this->assertEquals($attributeMetadata, unserialize($serialized));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,4 +62,21 @@ class ClassMetadataTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->assertEquals(array('a1' => $ac1), $classMetadata2->getAttributesMetadata());
|
||||
}
|
||||
|
||||
public function testSerialize()
|
||||
{
|
||||
$classMetadata = new ClassMetadata('a');
|
||||
|
||||
$a1 = $this->getMock('Symfony\Component\Serializer\Mapping\AttributeMetadataInterface');
|
||||
$a1->method('getName')->willReturn('b1');
|
||||
|
||||
$a2 = $this->getMock('Symfony\Component\Serializer\Mapping\AttributeMetadataInterface');
|
||||
$a2->method('getName')->willReturn('b2');
|
||||
|
||||
$classMetadata->addAttributeMetadata($a1);
|
||||
$classMetadata->addAttributeMetadata($a2);
|
||||
|
||||
$serialized = serialize($classMetadata);
|
||||
$this->assertEquals($classMetadata, unserialize($serialized));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,8 +105,6 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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'),
|
||||
|
@ -136,8 +134,6 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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');
|
||||
|
@ -162,8 +158,6 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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');
|
||||
|
|
|
@ -102,8 +102,6 @@ class ObjectNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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'),
|
||||
|
|
|
@ -68,8 +68,6 @@ class PropertyNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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'),
|
||||
|
@ -83,8 +81,6 @@ class PropertyNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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';
|
||||
|
@ -109,8 +105,6 @@ class PropertyNormalizerTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
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';
|
||||
|
|
Reference in a new issue