Skip to content

Commit

Permalink
fixup! fix(test): exit code of lime test
Browse files Browse the repository at this point in the history
  • Loading branch information
alquerci committed Mar 27, 2024
1 parent d914731 commit d094b34
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
13 changes: 13 additions & 0 deletions test/unit/vendor/lime/fixtures/pass_with_one_error.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

require_once __DIR__.'/../../../../bootstrap/unit.php';

error_reporting(-1);

$test = new lime_test(null, [
'error_reporting' => true,
]);

trigger_error('some use error message', E_USER_ERROR);

$test->is(true, true);
17 changes: 16 additions & 1 deletion test/unit/vendor/lime/limeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct()
}
}

$test = new lime_test(16);
$test = new lime_test(18);

$files = [
__DIR__.'/fixtures/failed.php',
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit d094b34

Please sign in to comment.