if (PHP_SAPI !== 'cli') {
die("phpunit can only be run from command line.");
}
-
-$phpunit = findCommand('phpunit4');
+if (version_compare(PHP_VERSION, '5.6', '>=')) {
+ $phpunit = findCommand('phpunit5');
+}
+else {
+ $phpunit = findCommand('phpunit4');
+}
if (!$phpunit) {
$phpunit = findCommand('phpunit');
}