From eda72a6f3b945736510c44bbe980afce65f8e5eb Mon Sep 17 00:00:00 2001 From: Corey Taylor Date: Fri, 6 Dec 2019 01:14:26 -0600 Subject: [PATCH] Updated CakeTestSuiteCommand::run() exit logic to match phpunit's behavior now that doRun() is called with =false. --- lib/Cake/TestSuite/CakeTestSuiteCommand.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Cake/TestSuite/CakeTestSuiteCommand.php b/lib/Cake/TestSuite/CakeTestSuiteCommand.php index 9e1cda5fc..9d83e8ff7 100644 --- a/lib/Cake/TestSuite/CakeTestSuiteCommand.php +++ b/lib/Cake/TestSuite/CakeTestSuiteCommand.php @@ -101,12 +101,15 @@ 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); } - exit(PHPUnit_TextUI_TestRunner::FAILURE_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); } }