
php_unit_data_provider_return_type
¶The return type of PHPUnit data provider must be iterable
.
Data provider must return iterable
, either an array of arrays or an object
that implements the Traversable
interface.
--- Original
+++ New
<?php
class FooTest extends TestCase {
/**
* @dataProvider provideSomethingCases
*/
public function testSomething($expected, $actual) {}
- public function provideSomethingCases(): array {}
+ public function provideSomethingCases(): iterable {}
}
--- Original
+++ New
<?php
class FooTest extends TestCase {
/**
* @dataProvider provideSomethingCases
*/
public function testSomething($expected, $actual) {}
- public function provideSomethingCases() {}
+ public function provideSomethingCases(): iterable {}
}