From fac6351c504c4dd9e3b5209f5e05c74dfadfdab8 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 5 May 2018 09:01:04 +1000 Subject: [PATCH] If php version supports it use phpunit5 otherwise phpunit4 --- tools/scripts/phpunit | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/scripts/phpunit b/tools/scripts/phpunit index 1d5bee225a..f3c5d61724 100755 --- a/tools/scripts/phpunit +++ b/tools/scripts/phpunit @@ -13,8 +13,12 @@ if (PHP_SAPI !== 'cli') { die("phpunit can only be run from command line."); } - -$phpunit = findCommand('phpunit5'); +if (version_compare(PHP_VERSION, '5.6', '>=')) { + $phpunit = findCommand('phpunit5'); +} +else { + $phpunit = findCommand('phpunit4'); +} if (!$phpunit) { $phpunit = findCommand('phpunit'); } -- 2.25.1