From 4b7b3bbe6eb7b67d98debb23f2ccb111a6ed9882 Mon Sep 17 00:00:00 2001 From: Ruud Kamphuis Date: Sun, 3 Dec 2017 18:29:00 +0100 Subject: [PATCH] Upgrade PHPUnit --- composer.json | 2 +- .../Compiler/ConfigureMiddlewaresTest.php | 2 +- tests/bootstrap.php | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 27ed31b..07c923d 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "symfony/monolog-bundle": "For logging messages" }, "require-dev": { - "phpunit/phpunit": "~4.0 || ~5.0", + "phpunit/phpunit": "^5.7 || ^6.0", "simple-bus/doctrine-orm-bridge": "~5.0", "doctrine/orm": "~2.3", "doctrine/doctrine-bundle": "~1.0", diff --git a/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php b/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php index a264ebc..9fef187 100644 --- a/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php +++ b/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php @@ -10,7 +10,7 @@ use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\HttpKernel\Kernel; -class ConfigureMiddlewaresTest extends \PHPUnit_Framework_TestCase +class ConfigureMiddlewaresTest extends \PHPUnit\Framework\TestCase { /** * @var ContainerBuilder diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 0de04ce..a6eea4e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -5,3 +5,10 @@ require __DIR__ . '/../vendor/autoload.php'; AnnotationRegistry::registerLoader('class_exists'); + +// Polyfill PHPUnit 6.0 both ways +if (!class_exists('\PHPUnit\Framework\TestCase', true)) { + class_alias('\PHPUnit_Framework_TestCase', '\PHPUnit\Framework\TestCase'); +} elseif (!class_exists('\PHPUnit_Framework_TestCase', true)) { + class_alias('\PHPUnit\Framework\TestCase', '\PHPUnit_Framework_TestCase'); +}