Make test suites compatible with PHPUnit 4.8

This commit is contained in:
chinpei215 2017-03-11 07:24:41 +09:00
parent 31a1837c1d
commit 23080c443e
3 changed files with 8 additions and 4 deletions

View file

@ -15,7 +15,7 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/ */
if (!defined('__PHPUNIT_PHAR__')) { if (!class_exists('PHPUnit_TextUI_TestRunner')) {
require_once 'PHPUnit/TextUI/TestRunner.php'; require_once 'PHPUnit/TextUI/TestRunner.php';
} }
@ -52,7 +52,11 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
} }
$fixture = $this->_getFixtureManager($arguments); $fixture = $this->_getFixtureManager($arguments);
foreach ($suite->getIterator() as $test) { $iterator = $suite->getIterator();
if ($iterator instanceof RecursiveIterator) {
$iterator = new RecursiveIteratorIterator($iterator);
}
foreach ($iterator as $test) {
if ($test instanceof CakeTestCase) { if ($test instanceof CakeTestCase) {
$fixture->fixturize($test); $fixture->fixturize($test);
$test->fixtureManager = $fixture; $test->fixtureManager = $fixture;

View file

@ -16,7 +16,7 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/ */
if (!defined('__PHPUNIT_PHAR__')) { if (!class_exists('PHPUnit_TextUI_Command')) {
require_once 'PHPUnit/TextUI/Command.php'; require_once 'PHPUnit/TextUI/Command.php';
} }

View file

@ -15,7 +15,7 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License * @license http://www.opensource.org/licenses/mit-license.php MIT License
*/ */
if (!defined('__PHPUNIT_PHAR__')) { if (!class_exists('PHPUnit_TextUI_ResultPrinter')) {
require_once 'PHPUnit/TextUI/ResultPrinter.php'; require_once 'PHPUnit/TextUI/ResultPrinter.php';
} }