Skip to content

Commit

Permalink
Add test for #5178
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 7, 2023
1 parent 5f4a775 commit 79f446b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/end-to-end/regression/5178.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--TEST--
https://github.com/sebastianbergmann/phpunit/issues/5178
--FILE--
<?php declare(strict_types=1);
$_SERVER['argv'][] = '--do-not-cache-result';
$_SERVER['argv'][] = '--no-configuration';
$_SERVER['argv'][] = __DIR__ . '/5178/Issue5178Test.php';

require_once __DIR__ . '/../../bootstrap.php';
(new PHPUnit\TextUI\Application)->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)
35 changes: 35 additions & 0 deletions tests/end-to-end/regression/5178/Issue5178Test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php declare(strict_types=1);
/*
* This file is part of PHPUnit.
*
* (c) Sebastian Bergmann <[email protected]>
*
* 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);
}
}

0 comments on commit 79f446b

Please sign in to comment.