File tree Expand file tree Collapse file tree 2 files changed +51
-0
lines changed
tests/end-to-end/regression Expand file tree Collapse file tree 2 files changed +51
-0
lines changed Original file line number Diff line number Diff line change 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)
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments