From d094b344b6541f796dafc55395b6657a84e83f9b Mon Sep 17 00:00:00 2001 From: Alexandre Quercia Date: Wed, 27 Mar 2024 21:14:23 +0100 Subject: [PATCH] fixup! fix(test): exit code of lime test --- .../lime/fixtures/pass_with_one_error.php | 13 +++++++++++++ test/unit/vendor/lime/limeTest.php | 17 ++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 test/unit/vendor/lime/fixtures/pass_with_one_error.php diff --git a/test/unit/vendor/lime/fixtures/pass_with_one_error.php b/test/unit/vendor/lime/fixtures/pass_with_one_error.php new file mode 100644 index 000000000..280204204 --- /dev/null +++ b/test/unit/vendor/lime/fixtures/pass_with_one_error.php @@ -0,0 +1,13 @@ + true, +]); + +trigger_error('some use error message', E_USER_ERROR); + +$test->is(true, true); diff --git a/test/unit/vendor/lime/limeTest.php b/test/unit/vendor/lime/limeTest.php index 20303bfa0..99cbf1062 100644 --- a/test/unit/vendor/lime/limeTest.php +++ b/test/unit/vendor/lime/limeTest.php @@ -43,7 +43,7 @@ public function __construct() } } -$test = new lime_test(16); +$test = new lime_test(18); $files = [ __DIR__.'/fixtures/failed.php', @@ -98,6 +98,21 @@ public function __construct() $message = 'with at least one test file that not follow the plan will fail the overall test suite'; whenExecuteHarnessWithFilesWillHaveResultAndOutput($test, $files, $expectedOverallSucceed, $expectedOutput, $message); +$files = [__DIR__.'/fixtures/pass_with_one_error.php']; +$expectedOverallSucceed = false; +$expectedOutput = <<<'EOF' +test/unit/vendor/lime/fixtures/pass_with_one_error...................errors + Errors: + - Notice: some use error message +Failed Test Stat Total Fail Errors List of Failed +-------------------------------------------------------------------------- +e/fixtures/pass_with_one_error 1 1 0 1 +Failed 1/1 test scripts, 0.00% okay. 0/1 subtests failed, 100.00% okay. + +EOF; +$message = 'with at least one error will fail the overall test suite'; +whenExecuteHarnessWithFilesWillHaveResultAndOutput($test, $files, $expectedOverallSucceed, $expectedOutput, $message); + $name = 'pass'; $expectedStatusCode = 0;