Skip to content

Commit

Permalink
minor #13580 [Serializer] Use autoloader for annotations in tests (du…
Browse files Browse the repository at this point in the history
…nglas)

This PR was merged into the 2.7 branch.

Discussion
----------

[Serializer] Use autoloader for annotations in tests

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Doc PR        | n/a

Commits
-------

75e2ebf [Serializer] Use autoloader for annotations in tests
  • Loading branch information
fabpot committed Feb 4, 2015
2 parents 1beb760 + 75e2ebf commit 54e07c9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Expand Up @@ -22,8 +22,6 @@
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
{
/**
Expand Down
Expand Up @@ -21,8 +21,6 @@
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
{
/**
Expand Down
14 changes: 14 additions & 0 deletions src/Symfony/Component/Serializer/Tests/bootstrap.php
@@ -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); });
2 changes: 1 addition & 1 deletion src/Symfony/Component/Serializer/phpunit.xml.dist
Expand Up @@ -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 -->
Expand Down

0 comments on commit 54e07c9

Please sign in to comment.