Updated CakeTestSuiteCommand::run() exit logic to match phpunit's behavior now that doRun() is called with =false.

This commit is contained in:
Corey Taylor 2019-12-06 01:14:26 -06:00
parent 0992fa1c41
commit eda72a6f3b

View file

@ -101,13 +101,16 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
} }
if ($exit) { if ($exit) {
if (isset($result) && $result->wasSuccessful()) { if (!isset($result) || $result->errorCount() > 0) {
exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
} elseif (!isset($result) || $result->errorCount() > 0) {
exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT); exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
} }
if ($result->failureCount() > 0) {
exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT); exit(PHPUnit_TextUI_TestRunner::FAILURE_EXIT);
} }
// Default to success even if there are warnings to match phpunit's behavior
exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
}
} }
/** /**