From 82ee6925253f3c27753be981ce10ad6146dc1917 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Fri, 3 Aug 2018 08:05:54 -0700 Subject: [PATCH 1/2] Fix phpunit version detection --- scripts/phpunit/bootstrap.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/phpunit/bootstrap.php b/scripts/phpunit/bootstrap.php index 4ce268cbc..d44fa1588 100644 --- a/scripts/phpunit/bootstrap.php +++ b/scripts/phpunit/bootstrap.php @@ -4,6 +4,15 @@ // PHPUnit 6 with a minimum of fuss. // // Code adopted from core/tests/bootstrap.php. + +// Ensure we have the correct PHPUnit version for the version of PHP. +if (class_exists('\PHPUnit_Runner_Version')) { + $phpunit_version = \PHPUnit_Runner_Version::id(); +} +else { + $phpunit_version = Version::id(); +} + if (version_compare($phpunit_version, '6.1', '>=')) { class_alias('\PHPUnit\Framework\AssertionFailedError', '\PHPUnit_Framework_AssertionFailedError'); class_alias('\PHPUnit\Framework\Constraint\Count', '\PHPUnit_Framework_Constraint_Count'); From d579bc947317b4736a5bd6c176549edf079b43ad Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Fri, 3 Aug 2018 08:10:16 -0700 Subject: [PATCH 2/2] Update bootstrap.php --- scripts/phpunit/bootstrap.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/phpunit/bootstrap.php b/scripts/phpunit/bootstrap.php index d44fa1588..8a92113ad 100644 --- a/scripts/phpunit/bootstrap.php +++ b/scripts/phpunit/bootstrap.php @@ -1,9 +1,14 @@