File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change @@ -1568,5 +1568,62 @@ class SomeTest extends TestCase
15681568
15691569<br >
15701570
1571+ ### PublicStaticDataProviderRule
1572+
1573+ PHPUnit data provider method "%s" must be public
1574+
1575+ ``` yaml
1576+ rules :
1577+ - Symplify\PHPStanRules\Rules\PHPUnit\PublicStaticDataProviderRule
1578+ ` ` `
1579+
1580+ ` ` ` php
1581+ use PHPUnit\Framework\TestCase;
1582+
1583+ final class SomeTest extends TestCase
1584+ {
1585+ /**
1586+ * @dataProvider dataProvider
1587+ */
1588+ public function test() : array
1589+ {
1590+ return [];
1591+ }
1592+
1593+ protected function dataProvider() : array
1594+ {
1595+ return [];
1596+ }
1597+ }
1598+ ```
1599+
1600+ :x :
1601+
1602+ <br >
1603+
1604+ ``` php
1605+ use PHPUnit\Framework\TestCase;
1606+
1607+ final class SomeTest extends TestCase
1608+ {
1609+ /**
1610+ * @dataProvider dataProvider
1611+ */
1612+ public function test(): array
1613+ {
1614+ return [];
1615+ }
1616+
1617+ public static function dataProvider(): array
1618+ {
1619+ return [];
1620+ }
1621+ }
1622+ ```
1623+
1624+ :+1 :
1625+
1626+ <br >
1627+
15711628
15721629Happy coding!
You can’t perform that action at this time.
0 commit comments