@@ -231,6 +231,62 @@ Feature: TestCase
231231 When I run Psalm
232232 Then I see no errors
233233
234+ Scenario : Multiple valid iterable @dataProvider are allowed, and all are used
235+ Given I have the following code
236+ """
237+ use PHPUnit\Framework\Attributes;
238+
239+ final class MyTestCase extends TestCase
240+ {
241+ /** @return iterable<int,array<int,int>> */
242+ public function provider1() {
243+ yield [1];
244+ }
245+
246+ /** @return iterable<int,array<int,int>> */
247+ public function provider2() {
248+ yield [1];
249+ }
250+
251+ /**
252+ * @dataProvider provider1
253+ * @dataProvider provider2
254+ */
255+ public function testSomething(int $int): void {
256+ $this->assertEquals(1, $int);
257+ }
258+ }
259+ """
260+ When I run Psalm with dead code detection
261+ Then I see no errors
262+
263+ Scenario : Multiple valid iterable #[DataProvider]s are allowed, and all are used
264+ Given I have the following code
265+ """
266+ use PHPUnit\Framework\Attributes;
267+
268+ final class MyTestCase extends TestCase
269+ {
270+ /** @return iterable<int,array<int,int>> */
271+ public function provider1() {
272+ yield [1];
273+ }
274+
275+ /** @return iterable<int,array<int,int>> */
276+ public function provider2() {
277+ yield [1];
278+ }
279+
280+ #[Attributes\DataProvider('provider1')]
281+ #[Attributes\DataProvider('provider2')]
282+ public function testSomething(int $int): void {
283+ $this->assertEquals(1, $int);
284+ }
285+ }
286+ """
287+ When I run Psalm with dead code detection
288+ Then I see no errors
289+
234290 Scenario : Invalid generator data provider is reported
235291 Given I have the following code
236292 """
0 commit comments