Skip to content

Commit 4cb9404

Browse files
committed
test more variadics
1 parent 9ee26b1 commit 4cb9404

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/Rules/PHPUnit/DataProviderDataRuleTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ public function testRule(): void
114114
'Parameter #2 $input of method DataProviderDataTest\YieldFromExpr::testFoo() expects string, true given.',
115115
277,
116116
],
117+
[
118+
'Parameter #1 $si of method DataProviderDataTest\TestInValidVariadic::testBar() expects int, string given.',
119+
333,
120+
],
121+
[
122+
'Parameter #1 $s of method DataProviderDataTest\TestInValidVariadic::testFoo() expects string, int given.',
123+
333,
124+
],
117125
]);
118126
}
119127

tests/Rules/PHPUnit/data/data-provider-data.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,24 @@ public function aProvider(): iterable
315315
];
316316
}
317317
}
318+
319+
class TestInValidVariadic extends TestCase
320+
{
321+
/** @dataProvider aProvider */
322+
public function testBar(int $si): void
323+
{
324+
}
325+
326+
/** @dataProvider aProvider */
327+
public function testFoo(string $s, string ...$moreS): void
328+
{
329+
}
330+
331+
public function aProvider(): iterable
332+
{
333+
return [
334+
["hello", "world", "foo", "bar"],
335+
[123]
336+
];
337+
}
338+
}

0 commit comments

Comments
 (0)