mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #13311 from tenkoma/2.x-exec-fixture-shutdown-phpunit5.2
[2.x]Fix When PHPUnit 5.2.0+, test ends before calling FixtureManager::shutdown()
This commit is contained in:
commit
396e342601
2 changed files with 3 additions and 2 deletions
|
@ -53,6 +53,7 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
|
|||
* @param PHPUnit_Framework_Test $suite The test suite to run
|
||||
* @param array $arguments The CLI arguments
|
||||
* @param bool $exit Exits by default or returns the results
|
||||
* This argument is ignored if >PHPUnit5.2.0
|
||||
* @return void
|
||||
*/
|
||||
public function doRun(PHPUnit_Framework_Test $suite, array $arguments = array(), $exit = true) {
|
||||
|
@ -72,7 +73,7 @@ class CakeTestRunner extends PHPUnit_TextUI_TestRunner {
|
|||
}
|
||||
}
|
||||
|
||||
$return = parent::doRun($suite, $arguments);
|
||||
$return = parent::doRun($suite, $arguments, $exit);
|
||||
$fixture->shutdown();
|
||||
return $return;
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
|
|||
unset($this->arguments['testFile']);
|
||||
|
||||
try {
|
||||
$result = $runner->doRun($suite, $this->arguments);
|
||||
$result = $runner->doRun($suite, $this->arguments, false);
|
||||
} catch (PHPUnit_Framework_Exception $e) {
|
||||
print $e->getMessage() . "\n";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue