Skip to content

Commit

Permalink
Closes #4632
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 28, 2021
1 parent c73c673 commit dbe8b5f
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog-9.5.md
Expand Up @@ -2,6 +2,12 @@

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

## [9.5.5] - 2021-MM-DD

### Fixed

* [#4632](https://github.com/sebastianbergmann/phpunit/issues/4632): TestDox result printer does not handle repeated test execution correctly

## [9.5.4] - 2021-03-23

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

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

[9.5.5]: https://github.com/sebastianbergmann/phpunit/compare/9.5.4...9.5
[9.5.4]: https://github.com/sebastianbergmann/phpunit/compare/9.5.3...9.5.4
[9.5.3]: https://github.com/sebastianbergmann/phpunit/compare/9.5.2...9.5.3
[9.5.2]: https://github.com/sebastianbergmann/phpunit/compare/9.5.1...9.5.2
Expand Down
3 changes: 2 additions & 1 deletion src/Util/TestDox/TestDoxPrinter.php
Expand Up @@ -239,7 +239,8 @@ protected function flushOutputBuffer(bool $forceFlush = false): void
}

if ($this->testFlushIndex > 0) {
if ($this->enableOutputBuffer) {
if ($this->enableOutputBuffer &&
isset($this->originalExecutionOrder[$this->testFlushIndex - 1])) {
$prevResult = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex - 1]);
} else {
$prevResult = $this->testResults[$this->testFlushIndex - 1];
Expand Down
45 changes: 45 additions & 0 deletions tests/end-to-end/regression/GitHub/4632.phpt
@@ -0,0 +1,45 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/issues/4632
--FILE--
<?php declare(strict_types=1);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--testdox';
$_SERVER['argv'][] = '--repeat';
$_SERVER['argv'][] = '3';
$_SERVER['argv'][] = __DIR__ . '/4632/Issue4632Test.php';

require __DIR__ . '/../../../bootstrap.php';

PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Issue4632 (PHPUnit\TestFixture\Issue4632)
One
Failed asserting that false is true.
│ %s/Issue4632Test.php:18

One
Failed asserting that false is true.
│ %s/Issue4632Test.php:18

One
Failed asserting that false is true.
│ %s/Issue4632Test.php:18

Time: %s, Memory: %s


FAILURES!
Tests: 3, Assertions: 3, Failures: 3.
20 changes: 20 additions & 0 deletions tests/end-to-end/regression/GitHub/4632/Issue4632Test.php
@@ -0,0 +1,20 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\TestFixture;

use PHPUnit\Framework\TestCase;

final class Issue4632Test extends TestCase
{
public function testOne(): void
{
$this->assertTrue(false);
}
}

0 comments on commit dbe8b5f

Please sign in to comment.