File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed
tests/end-to-end/regression Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ public function testPrepared(): void
202
202
*/
203
203
public function testFinished (Finished $ event ): void
204
204
{
205
- if ($ this ->preparationFailed ) {
205
+ if (! $ this -> prepared || $ this ->preparationFailed ) {
206
206
return ;
207
207
}
208
208
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ https://github.com/sebastianbergmann/phpunit/issues/5771
3
+ --FILE--
4
+ <?php declare (strict_types=1 );
5
+ $ _SERVER ['argv ' ][] = '--no-configuration ' ;
6
+ $ _SERVER ['argv ' ][] = '--no-output ' ;
7
+ $ _SERVER ['argv ' ][] = __DIR__ . '/5771/Issue5771Test.php ' ;
8
+ $ _SERVER ['argv ' ][] = '--log-junit ' ;
9
+ $ _SERVER ['argv ' ][] = 'php://stdout ' ;
10
+
11
+ require_once __DIR__ . '/../../bootstrap.php ' ;
12
+
13
+ (new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
14
+ --EXPECTF --
15
+ <? xml version="1.0 " encoding="UTF -8 "?>
16
+ <testsuites>
17
+ <testsuite name="PHPUnit\TestFixture\Issue5771\Issue5771Test" file="%sIssue5771Test.php" tests="1" assertions="0" errors="1" failures="0" skipped="0" time="%s">
18
+ <testcase name="testOne" file="%sIssue5771Test.php" line="18" class="PHPUnit\TestFixture\Issue5771\Issue5771Test" classname="PHPUnit.TestFixture.Issue5771.Issue5771Test" assertions="0" time="%s">
19
+ <error type="PHPUnit\Framework\AssertionFailedError">PHPUnit\TestFixture\Issue5771\Issue5771Test::testOne
20
+ Test was run in child process and ended unexpectedly</error>
21
+ </testcase>
22
+ </testsuite>
23
+ </testsuites>
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+ /*
3
+ * This file is part of PHPUnit.
4
+ *
5
+ * (c) Sebastian Bergmann <sebastian@phpunit.de>
6
+ *
7
+ * For the full copyright and license information, please view the LICENSE
8
+ * file that was distributed with this source code.
9
+ */
10
+ namespace PHPUnit \TestFixture \Issue5771 ;
11
+
12
+ use PHPUnit \Framework \Attributes \RunInSeparateProcess ;
13
+ use PHPUnit \Framework \TestCase ;
14
+
15
+ final class Issue5771Test extends TestCase
16
+ {
17
+ #[RunInSeparateProcess]
18
+ public function testOne (): void
19
+ {
20
+ exit ;
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments