Data transfer methods must return an array containing one array for each set of arguments in order to proceed to the testing method. To pass an array, include it in other arguments. Note that in your sample code you will need another enclosing array.
Here is an example that returns two data sets, each with two arguments (array and string).
public function dataProvider() { return array( // data sets array( // data set 0 array( // first argument 'id' => 1, 'description' => 'this', ), 'foo', // second argument ), array( // data set 1 array( // first argument 'id' => 2, 'description' => 'that', ), 'bar', // second argument ), ); }
Important: Data provider methods must be non-statistical. PHPUnit instantiates a test case to call each data provider method.
source share