Skip to content

Commit 37961cf

Browse files
committed
test unknown PHPUnit version
1 parent 0f7c2c9 commit 37961cf

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

tests/Rules/PHPUnit/DataProviderDeclarationRuleTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class DataProviderDeclarationRuleTest extends RuleTestCase
1313
{
14-
private int $phpunitVersion;
14+
private ?int $phpunitVersion;
1515

1616
protected function getRule(): Rule
1717
{
@@ -73,9 +73,12 @@ public function testRule(): void
7373
]);
7474
}
7575

76-
public function testRulePhpUnit9(): void
76+
/**
77+
* @dataProvider provideVersion
78+
*/
79+
public function testRulePhpUnit9orUnknown(?int $version): void
7780
{
78-
$this->phpunitVersion = 9;
81+
$this->phpunitVersion = $version;
7982

8083
$this->analyse([__DIR__ . '/data/data-provider-declaration.php'], [
8184
[
@@ -97,6 +100,12 @@ public function testRulePhpUnit9(): void
97100
]);
98101
}
99102

103+
public function provideVersion(): iterable
104+
{
105+
yield [9];
106+
yield [null];
107+
}
108+
100109
public function testFixDataProviderStatic(): void
101110
{
102111
$this->phpunitVersion = 10;

0 commit comments

Comments
 (0)