Is it allowed to return objects from @dataProviders
to test methods?
public function iOsMessages()
{
return [
'update available' => [1, new UpToDateMessage(), 'pl'],
];
}
/**
* @test
* @dataProvider iOsMessages
*/
public function success_create_message_for_ios(int $appVersion, MobileMessage $message, string $locale)
{
(...)
Error:
The data provider specified for Tests\Tests\Mobile\Classes\AppVersionTest::success_create_message_for_ios is invalid. Class 'Mobile\Classes\Messages\UpToDateMessage' not found
MobileMessage
is an interface, imports are correct.
From the documentation:
A data provider method must be public and either return an array of arrays or an object that implements the Iterator interface and yields an array for each iteration step.