From 04c46dadee60629505fe2b4d62d45b3ae8581e96 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 21 May 2021 09:50:52 +1000 Subject: [PATCH] Use PHPUnit8 for main runs --- tools/scripts/phpunit | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tools/scripts/phpunit b/tools/scripts/phpunit index 37f1e3f672..e941348381 100755 --- a/tools/scripts/phpunit +++ b/tools/scripts/phpunit @@ -15,7 +15,17 @@ $argFilters = []; if (PHP_SAPI !== 'cli') { die("phpunit can only be run from command line."); } -if (version_compare(PHP_VERSION, '7.1', '>=')) { +if (version_compare(PHP_VERSION, '7.2', '>=')) { + $phpunit = findCommand('phpunit8'); + $argFilters[] = function ($argv) { + $pos = array_search('--tap', $argv); + if ($pos !== FALSE) { + array_splice($argv, $pos, 1, ['--printer', '\Civi\Test\TAP']); + } + return $argv; + }; +} +elseif (version_compare(PHP_VERSION, '7.1', '>=')) { $phpunit = findCommand('phpunit7'); $argFilters[] = function ($argv) { $pos = array_search('--tap', $argv); -- 2.25.1