Skip to content

Commit 1b24a34

Browse files
Merge branch '11.5' into 12.3
2 parents 21703b1 + fc4f86e commit 1b24a34

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

tests/end-to-end/regression/4347.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/4347
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = __DIR__ . '/4347/TestIssue4347.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+
. 1 / 1 (100%)
18+
19+
Time: %s, Memory: %s
20+
21+
OK (1 test, 1 assertion)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TestFixture;
11+
12+
use Exception;
13+
use PHPUnit\Framework\Attributes\DataProvider;
14+
use PHPUnit\Framework\TestCase;
15+
16+
class TestIssue4347 extends TestCase
17+
{
18+
public static function thisMethodDataProvider()
19+
{
20+
return [
21+
[new Exception('my message')],
22+
];
23+
}
24+
25+
#[DataProvider('thisMethodDataProvider')]
26+
public function testThisMethod(Exception $expectedException): void
27+
{
28+
$this->assertSame('my message', $expectedException->getMessage());
29+
}
30+
}

0 commit comments

Comments
 (0)