Skip to content

Commit

Permalink
fixes #3881
Browse files Browse the repository at this point in the history
  • Loading branch information
realFlowControl authored and sebastianbergmann committed Oct 4, 2019
1 parent be7389e commit 0642dee
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Runner/StandardTestSuiteLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public function load(string $suiteClassName, string $suiteClassFile = ''): Refle
);
}

if ($class->isAbstract()) {
continue;
}

if (\substr($loadedClass, $offset) === $suiteClassName &&
$class->getFileName() == $filename) {
$suiteClassName = $loadedClass;
Expand Down
18 changes: 18 additions & 0 deletions tests/end-to-end/regression/GitHub/3881.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/issues/3881
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][1] = '--no-configuration';
$_SERVER['argv'][3] = __DIR__ . '/3881/Issue3881Test.php';

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

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

. 1 / 1 (100%)

Time: %s, Memory: %s

OK (1 test, 1 assertion)
14 changes: 14 additions & 0 deletions tests/end-to-end/regression/GitHub/3881/Issue3881Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
use PHPUnit\Framework\TestCase;

abstract class AbstractIssue3881Test extends TestCase
{
public function testOne(): void
{
$this->assertTrue(true);
}
}

final class Issue3881Test extends AbstractIssue3881Test
{
}

0 comments on commit 0642dee

Please sign in to comment.