Merge pull request #13984 from othercorey/2.x-phpunit-warnings

2.x - Updated CakeTestSuiteCommand::run() exit logic to match phpunit's
This commit is contained in:
Mark Story 2019-12-06 10:14:14 -05:00 committed by GitHub
commit 13fba738f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,13 +101,16 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command {
}
if ($exit) {
if (isset($result) && $result->wasSuccessful()) {
exit(PHPUnit_TextUI_TestRunner::SUCCESS_EXIT);
} elseif (!isset($result) || $result->errorCount() > 0) {
if (!isset($result) || $result->errorCount() > 0) {
exit(PHPUnit_TextUI_TestRunner::EXCEPTION_EXIT);
}
if ($result->failureCount() > 0) {
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);
}
}
/**