laravel-actions
laravel-actions copied to clipboard
assertPushed() does not seem to work with queue sync
Hi!
I have this test assertion in my tests:
SendWelcomeEmail::assertPushed(function (SendWelcomeEmail $job) use ($user) {
return ($job->user->id === $user->id) && !empty($job->new_password);
});
And I get this error in console when I run them:
Call to undefined method Illuminate\Queue\SyncQueue::pushed()
(...)
1 ...\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:337
Illuminate\Queue\QueueManager::__call("pushed")
2 ...\vendor\lorisleiva\laravel-actions\src\Concerns\AsJob.php:138
Illuminate\Support\Facades\Facade::__callStatic("pushed")
Of course, in my testing environment I have the queue env in sync:
phpunit.xml:
<env name="QUEUE_CONNECTION" value="sync"/>
Am I doing something wrong, or is it a bug on the assertion method when working with the sync queue driver and laravel actions?
Thanks!