Skip to content

Commit f33842f

Browse files
Merge branch '9.5'
2 parents dc2d6c4 + dbe8b5f commit f33842f

File tree

4 files changed

+74
-1
lines changed

4 files changed

+74
-1
lines changed

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

5+
## [9.5.5] - 2021-MM-DD
6+
7+
### Fixed
8+
9+
* [#4632](https://github.com/sebastianbergmann/phpunit/issues/4632): TestDox result printer does not handle repeated test execution correctly
10+
511
## [9.5.4] - 2021-03-23
612

713
### Fixed
@@ -41,6 +47,7 @@ All notable changes of the PHPUnit 9.5 release series are documented in this fil
4147

4248
* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly
4349

50+
[9.5.5]: https://github.com/sebastianbergmann/phpunit/compare/9.5.4...9.5
4451
[9.5.4]: https://github.com/sebastianbergmann/phpunit/compare/9.5.3...9.5.4
4552
[9.5.3]: https://github.com/sebastianbergmann/phpunit/compare/9.5.2...9.5.3
4653
[9.5.2]: https://github.com/sebastianbergmann/phpunit/compare/9.5.1...9.5.2

src/Util/TestDox/TestDoxPrinter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ protected function flushOutputBuffer(bool $forceFlush = false): void
229229
}
230230

231231
if ($this->testFlushIndex > 0) {
232-
if ($this->enableOutputBuffer) {
232+
if ($this->enableOutputBuffer &&
233+
isset($this->originalExecutionOrder[$this->testFlushIndex - 1])) {
233234
$prevResult = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex - 1]);
234235
} else {
235236
$prevResult = $this->testResults[$this->testFlushIndex - 1];
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/4632
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
6+
$_SERVER['argv'][] = '--do-not-cache-result';
7+
$_SERVER['argv'][] = '--no-configuration';
8+
$_SERVER['argv'][] = '--testdox';
9+
$_SERVER['argv'][] = '--repeat';
10+
$_SERVER['argv'][] = '3';
11+
$_SERVER['argv'][] = __DIR__ . '/4632/Issue4632Test.php';
12+
13+
require __DIR__ . '/../../../bootstrap.php';
14+
15+
PHPUnit\TextUI\Command::main();
16+
--EXPECTF--
17+
PHPUnit %s by Sebastian Bergmann and contributors.
18+
19+
Issue4632 (PHPUnit\TestFixture\Issue4632)
20+
✘ One
21+
22+
│ Failed asserting that false is true.
23+
24+
│ %s/Issue4632Test.php:18
25+
26+
27+
✘ One
28+
29+
│ Failed asserting that false is true.
30+
31+
│ %s/Issue4632Test.php:18
32+
33+
34+
✘ One
35+
36+
│ Failed asserting that false is true.
37+
38+
│ %s/Issue4632Test.php:18
39+
40+
41+
Time: %s, Memory: %s
42+
43+
44+
FAILURES!
45+
Tests: 3, Assertions: 3, Failures: 3.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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;
11+
12+
use PHPUnit\Framework\TestCase;
13+
14+
final class Issue4632Test extends TestCase
15+
{
16+
public function testOne(): void
17+
{
18+
$this->assertTrue(false);
19+
}
20+
}

0 commit comments

Comments
 (0)