Skip to content

Commit

Permalink
minor #21564 Update to PHPUnit namespaces (peterrehm)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 2.7 branch (closes #21564).

Discussion
----------

Update to PHPUnit namespaces

| Q             | A
| ------------- | ---
| Branch?       | 2.7+
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #21534
| License       | MIT
| Doc PR        | -

Replaces #21540

@nicolas-grekas Is the update of the cache-id like this sufficient? Do we maybe have to specifiy 4.8.35 in simple-phpunit?

Commits
-------

ddd2dff Update to PHPUnit namespaces
  • Loading branch information
fabpot committed Feb 18, 2017
2 parents 9d2bbc6 + ddd2dff commit c9684ad
Show file tree
Hide file tree
Showing 681 changed files with 1,434 additions and 728 deletions.
3 changes: 3 additions & 0 deletions composer.json
Expand Up @@ -24,6 +24,9 @@
"twig/twig": "~1.28|~2.0",
"psr/log": "~1.0"
},
"conflict": {
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0"
},
"replace": {
"symfony/asset": "self.version",
"symfony/browser-kit": "self.version",
Expand Down
2 changes: 1 addition & 1 deletion phpunit
@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php

// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/4f2aa873d2872a3b9782b25879fd628a0c418bc9
// Cache-Id: https://github.com/symfony/phpunit-bridge/commit/d3157d942a4590121dfd23f9cadf519ca6ad4ac7

if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bridge/Doctrine/Test/DoctrineTestHelper.php
Expand Up @@ -14,6 +14,7 @@
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\TestCase;

/**
* Provides utility functions needed in tests.
Expand All @@ -30,7 +31,7 @@ class DoctrineTestHelper
public static function createTestEntityManager()
{
if (!extension_loaded('pdo_sqlite')) {
\PHPUnit_Framework_TestCase::markTestSkipped('Extension pdo_sqlite is required.');
TestCase::markTestSkipped('Extension pdo_sqlite is required.');
}

$config = new \Doctrine\ORM\Configuration();
Expand Down
Expand Up @@ -11,10 +11,11 @@

namespace Symfony\Bridge\Doctrine\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\ContainerAwareEventManager;
use Symfony\Component\DependencyInjection\Container;

class ContainerAwareEventManagerTest extends \PHPUnit_Framework_TestCase
class ContainerAwareEventManagerTest extends TestCase
{
private $container;
private $evm;
Expand Down
Expand Up @@ -12,11 +12,12 @@
namespace Symfony\Bridge\Doctrine\Tests\DataCollector;

use Doctrine\DBAL\Platforms\MySqlPlatform;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\DataCollector\DoctrineDataCollector;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
class DoctrineDataCollectorTest extends TestCase
{
public function testCollectConnections()
{
Expand Down
Expand Up @@ -11,10 +11,11 @@

namespace Symfony\Bridge\Doctrine\Tests\DataFixtures;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader;
use Symfony\Bridge\Doctrine\Tests\Fixtures\ContainerAwareFixture;

class ContainerAwareLoaderTest extends \PHPUnit_Framework_TestCase
class ContainerAwareLoaderTest extends TestCase
{
public function testShouldSetContainerOnContainerAwareFixture()
{
Expand Down
Expand Up @@ -11,11 +11,12 @@

namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection\CompilerPass;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass\RegisterEventListenersAndSubscribersPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;

class RegisterEventListenersAndSubscribersPassTest extends \PHPUnit_Framework_TestCase
class RegisterEventListenersAndSubscribersPassTest extends TestCase
{
/**
* @expectedException \InvalidArgumentException
Expand Down
Expand Up @@ -11,14 +11,15 @@

namespace Symfony\Bridge\Doctrine\Tests\DependencyInjection;

use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;

/**
* @author Fabio B. Silva <fabio.bat.silva@gmail.com>
*/
class DoctrineExtensionTest extends \PHPUnit_Framework_TestCase
class DoctrineExtensionTest extends TestCase
{
/**
* @var \Symfony\Bridge\Doctrine\DependencyInjection\AbstractDoctrineExtension
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php
Expand Up @@ -14,6 +14,7 @@
@trigger_error('The '.__NAMESPACE__.'\DoctrineOrmTestCase class is deprecated since version 2.4 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper class instead.', E_USER_DEPRECATED);

use Doctrine\ORM\EntityManager;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;

/**
Expand All @@ -22,7 +23,7 @@
* @deprecated since version 2.4, to be removed in 3.0.
* Use {@link DoctrineTestHelper} instead.
*/
abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase
abstract class DoctrineOrmTestCase extends TestCase
{
/**
* @return EntityManager
Expand Down
Expand Up @@ -11,9 +11,10 @@

namespace Symfony\Bridge\Doctrine\Tests\ExpressionLanguage;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\ExpressionLanguage\DoctrineParserCache;

class DoctrineParserCacheTest extends \PHPUnit_Framework_TestCase
class DoctrineParserCacheTest extends TestCase
{
public function testFetch()
{
Expand Down
Expand Up @@ -14,6 +14,7 @@
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\Mapping\ClassMetadata;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Form\ChoiceList\DoctrineChoiceLoader;
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityLoaderInterface;
use Symfony\Bridge\Doctrine\Form\ChoiceList\IdReader;
Expand All @@ -23,7 +24,7 @@
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class DoctrineChoiceLoaderTest extends \PHPUnit_Framework_TestCase
class DoctrineChoiceLoaderTest extends TestCase
{
/**
* @var ChoiceListFactoryInterface|\PHPUnit_Framework_MockObject_MockObject
Expand Down
Expand Up @@ -16,13 +16,14 @@
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity;
use Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdNoToStringEntity;
use Symfony\Bridge\Doctrine\Form\ChoiceList\EntityChoiceList;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
use Symfony\Component\Form\Extension\Core\View\ChoiceView;
use Doctrine\ORM\Tools\SchemaTool;

/**
* @group legacy
*/
class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase
class GenericEntityChoiceListTest extends TestCase
{
const SINGLE_INT_ID_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIntIdEntity';

Expand Down
Expand Up @@ -11,12 +11,13 @@

namespace Symfony\Bridge\Doctrine\Tests\Form\ChoiceList;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Form\ChoiceList\ORMQueryBuilderLoader;
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\Version;

class ORMQueryBuilderLoaderTest extends \PHPUnit_Framework_TestCase
class ORMQueryBuilderLoaderTest extends TestCase
{
/**
* @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
Expand Down
Expand Up @@ -12,12 +12,13 @@
namespace Symfony\Bridge\Doctrine\Tests\Form\DataTransformer;

use Doctrine\Common\Collections\ArrayCollection;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Form\DataTransformer\CollectionToArrayTransformer;

/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class CollectionToArrayTransformerTest extends \PHPUnit_Framework_TestCase
class CollectionToArrayTransformerTest extends TestCase
{
/**
* @var CollectionToArrayTransformer
Expand Down
Expand Up @@ -12,11 +12,12 @@
namespace Symfony\Bridge\Doctrine\Tests\Form;

use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Form\DoctrineOrmTypeGuesser;
use Symfony\Component\Form\Guess\Guess;
use Symfony\Component\Form\Guess\ValueGuess;

class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase
class DoctrineOrmTypeGuesserTest extends TestCase
{
/**
* @dataProvider requiredProvider
Expand Down
Expand Up @@ -11,14 +11,15 @@

namespace Symfony\Bridge\Doctrine\Tests\HttpFoundation;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\HttpFoundation\DbalSessionHandler;

/**
* Test class for DbalSessionHandler.
*
* @author Drak <drak@zikula.org>
*/
class DbalSessionHandlerTest extends \PHPUnit_Framework_TestCase
class DbalSessionHandlerTest extends TestCase
{
public function testConstruct()
{
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php
Expand Up @@ -11,9 +11,10 @@

namespace Symfony\Bridge\Doctrine\Tests\Logger;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Logger\DbalLogger;

class DbalLoggerTest extends \PHPUnit_Framework_TestCase
class DbalLoggerTest extends TestCase
{
/**
* @dataProvider getLogFixtures
Expand Down
Expand Up @@ -11,12 +11,13 @@

namespace Symfony\Bridge\Doctrine\Tests\Security\User;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
use Symfony\Bridge\Doctrine\Tests\Fixtures\User;
use Symfony\Bridge\Doctrine\Security\User\EntityUserProvider;
use Doctrine\ORM\Tools\SchemaTool;

class EntityUserProviderTest extends \PHPUnit_Framework_TestCase
class EntityUserProviderTest extends TestCase
{
public function testRefreshUserGetsUserByPrimaryKey()
{
Expand Down
Expand Up @@ -12,6 +12,7 @@
namespace Symfony\Bridge\Monolog\Tests\Handler;

use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Monolog\Handler\ConsoleHandler;
use Symfony\Component\Console\ConsoleEvents;
use Symfony\Component\Console\Event\ConsoleCommandEvent;
Expand All @@ -26,7 +27,7 @@
*
* @author Tobias Schultze <http://tobion.de>
*/
class ConsoleHandlerTest extends \PHPUnit_Framework_TestCase
class ConsoleHandlerTest extends TestCase
{
public function testConstructor()
{
Expand Down
Expand Up @@ -11,13 +11,14 @@

namespace Symfony\Bridge\Monolog\Tests\Handler\FingersCrossed;

use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Monolog\Handler\FingersCrossed\NotFoundActivationStrategy;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Monolog\Logger;

class NotFoundActivationStrategyTest extends \PHPUnit_Framework_TestCase
class NotFoundActivationStrategyTest extends TestCase
{
/**
* @dataProvider isActivatedProvider
Expand Down
3 changes: 2 additions & 1 deletion src/Symfony/Bridge/Monolog/Tests/LoggerTest.php
Expand Up @@ -3,10 +3,11 @@
namespace Symfony\Bridge\Monolog\Tests;

use Monolog\Handler\TestHandler;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Monolog\Handler\DebugHandler;
use Symfony\Bridge\Monolog\Logger;

class LoggerTest extends \PHPUnit_Framework_TestCase
class LoggerTest extends TestCase
{
/**
* @group legacy
Expand Down
Expand Up @@ -12,10 +12,11 @@
namespace Symfony\Bridge\Monolog\Tests\Processor;

use Monolog\Logger;
use PHPUnit\Framework\TestCase;
use Symfony\Bridge\Monolog\Processor\WebProcessor;
use Symfony\Component\HttpFoundation\Request;

class WebProcessorTest extends \PHPUnit_Framework_TestCase
class WebProcessorTest extends TestCase
{
public function testUsesRequestServerData()
{
Expand Down
3 changes: 3 additions & 0 deletions src/Symfony/Bridge/PhpUnit/composer.json
Expand Up @@ -23,6 +23,9 @@
"suggest": {
"symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader"
},
"conflict": {
"phpunit/phpunit": ">=6.0"
},
"autoload": {
"files": [ "bootstrap.php" ],
"psr-4": { "Symfony\\Bridge\\PhpUnit\\": "" },
Expand Down
Expand Up @@ -13,6 +13,7 @@

require_once __DIR__.'/Fixtures/includes/foo.php';

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
use Symfony\Component\DependencyInjection\ContainerBuilder;

Expand All @@ -22,7 +23,7 @@
*
* @author Marco Pivetta <ocramius@gmail.com>
*/
class ContainerBuilderTest extends \PHPUnit_Framework_TestCase
class ContainerBuilderTest extends TestCase
{
public function testCreateProxyServiceWithRuntimeInstantiator()
{
Expand Down
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\Dumper;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
Expand All @@ -21,7 +22,7 @@
*
* @author Marco Pivetta <ocramius@gmail.com>
*/
class PhpDumperTest extends \PHPUnit_Framework_TestCase
class PhpDumperTest extends TestCase
{
public function testDumpContainerWithProxyService()
{
Expand Down
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\Instantiator;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
use Symfony\Component\DependencyInjection\Definition;

Expand All @@ -19,7 +20,7 @@
*
* @author Marco Pivetta <ocramius@gmail.com>
*/
class RuntimeInstantiatorTest extends \PHPUnit_Framework_TestCase
class RuntimeInstantiatorTest extends TestCase
{
/**
* @var RuntimeInstantiator
Expand Down
Expand Up @@ -11,6 +11,7 @@

namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
use Symfony\Component\DependencyInjection\Definition;

Expand All @@ -19,7 +20,7 @@
*
* @author Marco Pivetta <ocramius@gmail.com>
*/
class ProxyDumperTest extends \PHPUnit_Framework_TestCase
class ProxyDumperTest extends TestCase
{
/**
* @var ProxyDumper
Expand Down

0 comments on commit c9684ad

Please sign in to comment.