Skip to content

Commit

Permalink
Merge branch '8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 15, 2019
2 parents ffbbd97 + 7abef86 commit 430c22f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog-8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes of the PHPUnit 8.0 release series are documented in this fil
* Fixed [#3539](https://github.com/sebastianbergmann/phpunit/issues/3539): Wrong default value for `resolveDependencies` in `phpunit.xsd`
* Fixed [#3550](https://github.com/sebastianbergmann/phpunit/issues/3550): Check for valid attribute names in `assertObjectHasAttribute()` is too strict
* Fixed [#3555](https://github.com/sebastianbergmann/phpunit/issues/3555): Extension loader only allows objects that implement `TestHook` but should also allow `Hook`
* Fixed [#3560](https://github.com/sebastianbergmann/phpunit/issues/3560): TestDox does not work when tests are filtered

## [8.0.4] - 2019-02-18

Expand Down
6 changes: 3 additions & 3 deletions src/Util/TestDox/TestDoxPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function writeProgress(string $progress): void

public function flush(): void
{
$this->flushOutputBuffer();
$this->flushOutputBuffer(true);
}

/**
Expand Down Expand Up @@ -232,7 +232,7 @@ protected function testHasPassed(): bool
return false;
}

protected function flushOutputBuffer(): void
protected function flushOutputBuffer(bool $forceFlush = false): void
{
if ($this->testFlushIndex === $this->testIndex) {
return;
Expand All @@ -254,7 +254,7 @@ protected function flushOutputBuffer(): void
do {
$flushed = false;

if (isset($this->originalExecutionOrder[$this->testFlushIndex])) {
if (!$forceFlush && isset($this->originalExecutionOrder[$this->testFlushIndex])) {
$result = $this->getTestResultByName($this->originalExecutionOrder[$this->testFlushIndex]);
} else {
// This test(name) cannot found in original execution order,
Expand Down
25 changes: 25 additions & 0 deletions tests/end-to-end/loggers/testdox-force-flush.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--TEST--
phpunit --testdox --colors=never -c tests/basic/configuration.basic.xml --filter Success
--FILE--
<?php declare(strict_types=1);
$arguments = [
'-c',
realpath(__DIR__ . '/../../basic/configuration.basic.xml'),
'--testdox',
'--colors=never',
'--filter', 'Success'
];
\array_splice($_SERVER['argv'], 1, count($arguments), $arguments);

require __DIR__ . '/../../bootstrap.php';
PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

Test result status with and without message
Success
Success with message

Time: %s, Memory: %s

OK (2 tests, 2 assertions)

0 comments on commit 430c22f

Please sign in to comment.