Skip to content

Commit

Permalink
Closes #4630
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 23, 2021
1 parent aad51c0 commit 526479b
Show file tree
Hide file tree
Showing 4 changed files with 55 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.4] - 2021-MM-DD

### Fixed

* [#4630](https://github.com/sebastianbergmann/phpunit/issues/4630): Empty test case class causes error in TestDox XML logger

## [9.5.3] - 2021-03-17

### Fixed
Expand Down Expand Up @@ -35,6 +41,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.4]: https://github.com/sebastianbergmann/phpunit/compare/9.5.3...9.5
[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
[9.5.1]: https://github.com/sebastianbergmann/phpunit/compare/9.5.0...9.5.1
Expand Down
3 changes: 2 additions & 1 deletion src/Util/TestDox/XmlResultPrinter.php
Expand Up @@ -22,6 +22,7 @@
use PHPUnit\Framework\TestListener;
use PHPUnit\Framework\TestSuite;
use PHPUnit\Framework\Warning;
use PHPUnit\Framework\WarningTestCase;
use PHPUnit\Util\Printer;
use PHPUnit\Util\Test as TestUtil;
use ReflectionClass;
Expand Down Expand Up @@ -154,7 +155,7 @@ public function startTest(Test $test): void
*/
public function endTest(Test $test, float $time): void
{
if (!$test instanceof TestCase) {
if (!$test instanceof TestCase || $test instanceof WarningTestCase) {
return;
}

Expand Down
30 changes: 30 additions & 0 deletions tests/end-to-end/regression/GitHub/4630.phpt
@@ -0,0 +1,30 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/issues/4630
--FILE--
<?php declare(strict_types=1);

$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = '--testdox-xml';
$_SERVER['argv'][] = 'php://stdout';
$_SERVER['argv'][] = __DIR__ . '/4630/Issue4630Test.php';

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

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

W 1 / 1 (100%)<?xml version="1.0" encoding="UTF-8"?>
<tests/>


Time: %s, Memory: %s

There was 1 warning:

1) Warning
No tests found in class "PHPUnit\TestFixture\Issue4630Test".

WARNINGS!
Tests: 1, Assertions: 0, Warnings: 1.
16 changes: 16 additions & 0 deletions tests/end-to-end/regression/GitHub/4630/Issue4630Test.php
@@ -0,0 +1,16 @@
<?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 Issue4630Test extends TestCase
{
}

0 comments on commit 526479b

Please sign in to comment.