Skip to content

Commit 9229dfe

Browse files
staabmsebastianbergmann
authored andcommitted
Added regression test
1 parent 0bdb545 commit 9229dfe

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/6382
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = __DIR__ . '/6382/Issue6382Test.php';
8+
9+
require_once __DIR__ . '/../../bootstrap.php';
10+
11+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
12+
--EXPECTF--
13+
PHPUnit %s by Sebastian Bergmann and contributors.
14+
15+
Runtime: %s
16+
17+
18+
Fatal error: Declaration of Greg0ire\PhpunitReproducer\Child6382::__invoke() must be compatible with Greg0ire\PhpunitReproducer\Ancestor6382::__invoke(): void in %sChild.php on line %d
19+
Fatal error: Premature end of PHP process when running Issue6382Test::testExample.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Greg0ire\PhpunitReproducer;
4+
5+
interface Ancestor6382
6+
{
7+
public function __invoke(): void;
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
namespace Greg0ire\PhpunitReproducer;
4+
5+
interface Child6382 extends Ancestor6382
6+
{
7+
public function __invoke();
8+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
use PHPUnit\Framework\TestCase;
4+
use Greg0ire\PhpunitReproducer\Child6382;
5+
6+
class Issue6382Test extends TestCase
7+
{
8+
public function testExample(): void
9+
{
10+
require_once __DIR__.'/Ancestor.php';
11+
require_once __DIR__.'/Child.php';
12+
13+
new Child6382();
14+
}
15+
}

0 commit comments

Comments
 (0)