From 0e36059c0b4a453573ed5fbb1e2f45cf837aa963 Mon Sep 17 00:00:00 2001 From: Alexander Schranz Date: Wed, 6 Feb 2019 00:57:29 +0100 Subject: [PATCH] Fix PhpUnit 8 runner compatibility --- src/Symfony/Bridge/PhpUnit/bin/simple-phpunit | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit index 2e23aa8900542..29b3396b6bf8a 100755 --- a/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit +++ b/src/Symfony/Bridge/PhpUnit/bin/simple-phpunit @@ -90,6 +90,18 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__ if ($exit) { exit($exit); } + if ($PHPUNIT_VERSION >= 8.0) { + // fix compatibility to custom TestRunner for PhpUnit 8 compatibility + $testRunnerFile = 'src/TextUI/TestRunner.php'; + file_put_contents( + $testRunnerFile, + str_replace( + 'final class TestRunner', + 'class TestRunner', + file_get_contents($testRunnerFile) + ) + ); + } file_put_contents('phpunit', <<<'EOPHP'