
php_unit_data_provider_static
¶Data providers must be static.
Fixer could be risky if one is calling data provider function dynamically.
--- Original
+++ New
<?php
class FooTest extends TestCase {
/**
* @dataProvider provideSomethingCases
*/
public function testSomething($expected, $actual) {}
- public function provideSomethingCases() {}
+ public static function provideSomethingCases() {}
}
The rule is part of the following rule set:
Using the @PHPUnit100Migration:risky rule set will enable the php_unit_data_provider_static
rule.