Skip to content

Commit

Permalink
Make test suites compatible with PHPUnit 4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
chinpei215 committed Mar 25, 2017
1 parent 31a1837 commit 23080c4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions lib/Cake/TestSuite/CakeTestRunner.php
Expand Up @@ -15,7 +15,7 @@
* @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';
}

Expand Down Expand Up @@ -52,7 +52,11 @@ public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array())
}

$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) {
$fixture->fixturize($test);
$test->fixtureManager = $fixture;
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/TestSuite/CakeTestSuiteCommand.php
Expand Up @@ -16,7 +16,7 @@
* @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';
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/TestSuite/Reporter/CakeBaseReporter.php
Expand Up @@ -15,7 +15,7 @@
* @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';
}

Expand Down

0 comments on commit 23080c4

Please sign in to comment.