Skip to content

Commit fbffae7

Browse files
Closes #6103
1 parent 3fe56f6 commit fbffae7

File tree

5 files changed

+53
-9
lines changed

5 files changed

+53
-9
lines changed

ChangeLog-10.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 10.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [10.5.42] - 2025-MM-DD
6+
7+
### Fixed
8+
9+
* [#6103](https://github.com/sebastianbergmann/phpunit/issues/6103): Output from test run in separate process is printed twice
10+
511
## [10.5.41] - 2025-01-13
612

713
### Added
@@ -375,6 +381,7 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
375381

376382
* [#5563](https://github.com/sebastianbergmann/phpunit/issues/5563): `createMockForIntersectionOfInterfaces()` does not automatically register mock object for expectation verification
377383

384+
[10.5.42]: https://github.com/sebastianbergmann/phpunit/compare/10.5.41...10.5
378385
[10.5.41]: https://github.com/sebastianbergmann/phpunit/compare/10.5.40...10.5.41
379386
[10.5.40]: https://github.com/sebastianbergmann/phpunit/compare/10.5.39...10.5.40
380387
[10.5.39]: https://github.com/sebastianbergmann/phpunit/compare/10.5.38...10.5.39

src/Util/PHP/AbstractPhpProcess.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,6 @@ static function (int $errno, string $errstr, string $errfile, int $errline): nev
296296
}
297297

298298
if ($childResult !== false) {
299-
if (!empty($childResult['output'])) {
300-
$output = $childResult['output'];
301-
}
302-
303299
Facade::instance()->forward($childResult['events']);
304300
PassedTests::instance()->import($childResult['passedTests']);
305301

@@ -314,9 +310,5 @@ static function (int $errno, string $errstr, string $errfile, int $errline): nev
314310
);
315311
}
316312
}
317-
318-
if (!empty($output)) {
319-
print $output;
320-
}
321313
}
322314
}

tests/end-to-end/regression/1149.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ PHPUnit %s by Sebastian Bergmann and contributors.
1313

1414
Runtime: %s
1515

16-
1.2. 2 / 2 (100%)2
16+
1.2. 2 / 2 (100%)
1717

1818
Time: %s, Memory: %s
1919

tests/end-to-end/regression/6103.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/6103
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = __DIR__ . '/6103/Issue6103Test.php';
8+
9+
require_once __DIR__ . '/../../bootstrap.php';
10+
11+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
12+
--EXPECTF--
13+
PHPUnit %s by Sebastian Bergmann and contributors.
14+
15+
Runtime: %s
16+
17+
*. 1 / 1 (100%)
18+
19+
Time: %s, Memory: %s
20+
21+
OK (1 test, 1 assertion)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
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\Issue6103;
11+
12+
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
13+
use PHPUnit\Framework\TestCase;
14+
15+
final class Issue6103Test extends TestCase
16+
{
17+
#[RunInSeparateProcess]
18+
public function testOne(): void
19+
{
20+
print '*';
21+
22+
$this->assertTrue(true);
23+
}
24+
}

0 commit comments

Comments
 (0)