PHPUnit: Prevent 'Cannot redeclare class' error

The Travis environments of PHP 5.4 and 5.6 contained both the
namespaced and the global version of the TestCase class :-/
This commit is contained in:
Christian Bläul
2017-11-25 14:10:23 +01:00
committed by Fonata
parent db1e242d07
commit 7536d55f27

View File

@@ -5,6 +5,7 @@ defined('BASE') OR define('BASE', dirname($dir) . '/');
require_once BASE . 'parsecsv.lib.php';
if (class_exists('PHPUnit_Framework_TestCase')) {
if (!class_exists('PHPUnit\Framework\TestCase')) {
// we run on an older PHPUnit version without namespaces.
require_once __DIR__ . '/PHPUnit_Framework_TestCase.inc.php';
}