Skip to content

Commit aac2f4f

Browse files
committed
next rule
1 parent de1bad7 commit aac2f4f

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff 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

15721629
Happy coding!

0 commit comments

Comments
 (0)