From 1129d608de7abf39a29e6f6ec5d47a87f9b6dce3 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 1 Oct 2015 10:26:02 +0200 Subject: [PATCH] Use PHPUnit 5.0 for PHP 7 PHPUnit 4.8 is not fully compatible with PHP 7, and won't be fixed for full support. --- phpunit | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpunit b/phpunit index 7e1f519a26..0d91ad43f9 100755 --- a/phpunit +++ b/phpunit @@ -3,9 +3,14 @@ error_reporting(-1); -$PHPUNIT_VERSION = 4.8; +$PHPUNIT_VERSION = '4.8'; $PHPUNIT_DIR = __DIR__.'/.phpunit'; +// PHPUnit 4.8 does not support PHP 7, while 5.0 requires PHP 5.6+ +if (PHP_VERSION_ID >= 70000) { + $PHPUNIT_DIR = '5.0'; +} + if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit")) { // Build a standalone phpunit without symfony/yaml