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:
Mark Story 2019-06-02 21:54:29 -04:00 committed by GitHub
commit 396e342601
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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;
}

View file

@ -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";
}