Skip to content

Commit d094b34

Browse files
committed
fixup! fix(test): exit code of lime test
1 parent d914731 commit d094b34

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
require_once __DIR__.'/../../../../bootstrap/unit.php';
4+
5+
error_reporting(-1);
6+
7+
$test = new lime_test(null, [
8+
'error_reporting' => true,
9+
]);
10+
11+
trigger_error('some use error message', E_USER_ERROR);
12+
13+
$test->is(true, true);

test/unit/vendor/lime/limeTest.php

+16-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct()
4343
}
4444
}
4545

46-
$test = new lime_test(16);
46+
$test = new lime_test(18);
4747

4848
$files = [
4949
__DIR__.'/fixtures/failed.php',
@@ -98,6 +98,21 @@ public function __construct()
9898
$message = 'with at least one test file that not follow the plan will fail the overall test suite';
9999
whenExecuteHarnessWithFilesWillHaveResultAndOutput($test, $files, $expectedOverallSucceed, $expectedOutput, $message);
100100

101+
$files = [__DIR__.'/fixtures/pass_with_one_error.php'];
102+
$expectedOverallSucceed = false;
103+
$expectedOutput = <<<'EOF'
104+
test/unit/vendor/lime/fixtures/pass_with_one_error...................errors
105+
Errors:
106+
- Notice: some use error message
107+
Failed Test Stat Total Fail Errors List of Failed
108+
--------------------------------------------------------------------------
109+
e/fixtures/pass_with_one_error 1 1 0 1
110+
Failed 1/1 test scripts, 0.00% okay. 0/1 subtests failed, 100.00% okay.
111+
112+
EOF;
113+
$message = 'with at least one error will fail the overall test suite';
114+
whenExecuteHarnessWithFilesWillHaveResultAndOutput($test, $files, $expectedOverallSucceed, $expectedOutput, $message);
115+
101116

102117
$name = 'pass';
103118
$expectedStatusCode = 0;

0 commit comments

Comments
 (0)