From 7536d55f27fcee7a8e8b5268a8d7e85b4653d1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Bl=C3=A4ul?= Date: Sat, 25 Nov 2017 14:10:23 +0100 Subject: [PATCH] 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 :-/ --- tests/Bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Bootstrap.php b/tests/Bootstrap.php index 589745a..0999d1c 100644 --- a/tests/Bootstrap.php +++ b/tests/Bootstrap.php @@ -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'; }