Skip to content

Commit 03050de

Browse files
Closes #6134
1 parent 94dc922 commit 03050de

File tree

6 files changed

+13
-6
lines changed

6 files changed

+13
-6
lines changed

ChangeLog-11.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 11.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [11.5.9] - 2025-MM-DD
6+
7+
### Fixed
8+
9+
* [#6134](https://github.com/sebastianbergmann/phpunit/issues/6134): Missing event when child process ends unexpectedly
10+
511
## [11.5.8] - 2025-02-18
612

713
### Fixed
@@ -105,6 +111,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
105111
* [#6055](https://github.com/sebastianbergmann/phpunit/issues/6055): `assertNotContainsOnly()` (use `assertContainsNotOnlyArray()`, `assertContainsNotOnlyBool()`, `assertContainsNotOnlyCallable()`, `assertContainsNotOnlyFloat()`, `assertContainsNotOnlyInt()`, `assertContainsNotOnlyIterable()`, `assertContainsNotOnlyNumeric()`, `assertContainsNotOnlyObject()`, `assertContainsNotOnlyResource()`, `assertContainsNotOnlyClosedResource()`, `assertContainsNotOnlyScalar()`, or `assertContainsNotOnlyString()` instead)
106112
* [#6059](https://github.com/sebastianbergmann/phpunit/issues/6059): `containsOnly()` (use `containsOnlyArray()`, `containsOnlyBool()`, `containsOnlyCallable()`, `containsOnlyFloat()`, `containsOnlyInt()`, `containsOnlyIterable()`, `containsOnlyNumeric()`, `containsOnlyObject()`, `containsOnlyResource()`, `containsOnlyClosedResource()`, `containsOnlyScalar()`, or `containsOnlyString()` instead)
107113

114+
[11.5.9]: https://github.com/sebastianbergmann/phpunit/compare/11.5.8...11.5
108115
[11.5.8]: https://github.com/sebastianbergmann/phpunit/compare/11.5.7...11.5.8
109116
[11.5.7]: https://github.com/sebastianbergmann/phpunit/compare/11.5.6...11.5.7
110117
[11.5.6]: https://github.com/sebastianbergmann/phpunit/compare/11.5.5...11.5.6

src/Framework/TestRunner/templates/class.tpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ function __phpunit_run_isolated_test()
9999
}
100100
}
101101

102-
Facade::emitter()->testRunnerFinishedChildProcess($output, '');
103-
104102
file_put_contents(
105103
'{processResultFile}',
106104
serialize(

src/Framework/TestRunner/templates/method.tpl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,6 @@ function __phpunit_run_isolated_test()
9999
}
100100
}
101101

102-
Facade::emitter()->testRunnerFinishedChildProcess($output, '');
103-
104102
file_put_contents(
105103
'{processResultFile}',
106104
serialize(

src/Util/PHP/DefaultJobRunner.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,6 @@ private function runProcess(Job $job, ?string $temporaryFile): Result
118118
$environmentVariables,
119119
);
120120

121-
Facade::emitter()->testRunnerStartedChildProcess();
122-
123121
if (!is_resource($process)) {
124122
// @codeCoverageIgnoreStart
125123
throw new PhpProcessException(
@@ -128,6 +126,8 @@ private function runProcess(Job $job, ?string $temporaryFile): Result
128126
// @codeCoverageIgnoreEnd
129127
}
130128

129+
Facade::emitter()->testRunnerStartedChildProcess();
130+
131131
fwrite($pipes[0], $job->code());
132132
fclose($pipes[0]);
133133

src/Util/PHP/JobRunner.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use function file_get_contents;
1414
use function is_file;
1515
use function unlink;
16+
use PHPUnit\Event\Facade as EventFacade;
1617
use PHPUnit\Framework\ChildProcessResultProcessor;
1718
use PHPUnit\Framework\Test;
1819

@@ -52,6 +53,8 @@ final public function runTestJob(Job $job, string $processResultFile, Test $test
5253
$processResult,
5354
$result->stderr(),
5455
);
56+
57+
EventFacade::emitter()->testRunnerFinishedChildProcess($result->stdout(), $result->stderr());
5558
}
5659

5760
abstract public function run(Job $job): Result;

tests/end-to-end/event/unexpected-end-of-test-in-separate-process.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Child Process Started
2323
Test Errored (PHPUnit\TestFixture\Event\SeparateProcessesTest::testOne)
2424
Test was run in child process and ended unexpectedly
2525
Test Finished (PHPUnit\TestFixture\Event\SeparateProcessesTest::testOne)
26+
Child Process Finished
2627
Test Suite Finished (PHPUnit\TestFixture\Event\SeparateProcessesTest, 1 test)
2728
Test Runner Execution Finished
2829
Test Runner Finished

0 commit comments

Comments
 (0)