[Serializer] Use autoloader for annotations in tests

This commit is contained in:
Kévin Dunglas 2015-02-03 23:16:10 +01:00
parent fcd6d6085f
commit 75e2ebfa30
4 changed files with 15 additions and 5 deletions

View File

@ -22,8 +22,6 @@ use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
use Symfony\Component\Serializer\Tests\Fixtures\GroupDummy;
require_once __DIR__.'/../../Annotation/Groups.php';
class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase
{
/**

View File

@ -21,8 +21,6 @@ use Symfony\Component\Serializer\Tests\Fixtures\GroupDummy;
use Symfony\Component\Serializer\Tests\Fixtures\PropertyCircularReferenceDummy;
use Symfony\Component\Serializer\Tests\Fixtures\PropertySiblingHolder;
require_once __DIR__.'/../../Annotation/Groups.php';
class PropertyNormalizerTest extends \PHPUnit_Framework_TestCase
{
/**

View File

@ -0,0 +1,14 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
$loader = require __DIR__.'/../vendor/autoload.php';
Doctrine\Common\Annotations\AnnotationRegistry::registerLoader(function ($class) { return class_exists($class); });

View File

@ -4,7 +4,7 @@
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
bootstrap="Tests/bootstrap.php"
>
<php>
<!-- Disable E_USER_DEPRECATED until 3.0 -->