From 79f446bd3cd0d3d0cd40d1a6a334e54a988e035e Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Tue, 7 Feb 2023 14:11:13 +0100 Subject: [PATCH] Add test for #5178 --- tests/end-to-end/regression/5178.phpt | 22 ++++++++++++ .../regression/5178/Issue5178Test.php | 35 +++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 tests/end-to-end/regression/5178.phpt create mode 100644 tests/end-to-end/regression/5178/Issue5178Test.php diff --git a/tests/end-to-end/regression/5178.phpt b/tests/end-to-end/regression/5178.phpt new file mode 100644 index 00000000000..3959ea6d007 --- /dev/null +++ b/tests/end-to-end/regression/5178.phpt @@ -0,0 +1,22 @@ +--TEST-- +https://github.com/sebastianbergmann/phpunit/issues/5178 +--FILE-- +run($_SERVER['argv']); +--XFAIL-- +https://github.com/sebastianbergmann/phpunit/issues/5178 +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann and contributors. + +Runtime: %s + +... 3 / 3 (100%) + +Time: %s, Memory: %s + +OK (3 tests, 3 assertions) diff --git a/tests/end-to-end/regression/5178/Issue5178Test.php b/tests/end-to-end/regression/5178/Issue5178Test.php new file mode 100644 index 00000000000..5d94aee31d1 --- /dev/null +++ b/tests/end-to-end/regression/5178/Issue5178Test.php @@ -0,0 +1,35 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Depends; +use PHPUnit\Framework\TestCase; + +final class Issue5178Test extends TestCase +{ + public static function fooDataProvider(): array + { + return [ + 'foo 1' => ['Hello'], + 'foo 2' => ['World'], + ]; + } + + #[DataProvider('fooDataProvider')] + public function testFoo(string $input): void + { + $this->assertNotEmpty($input); + } + + #[Depends('testFoo')] + public function testBar(): void + { + $this->assertTrue(true); + } +}