You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I started to use your package which is extra to mock, and test mails ! Top. But now I would like to mock Laravel Queues and after doing this : $queue = $browser->fake(Queue::class); [...] $queue->assertNotPushed(SynchrUser::class);
And I get this error : Browser\UserActions ✘ Register │ │ Exception: Unable to retrieve mock for [Illuminate\Support\Facades\Queue]. │ │ /var/www/emploi2/vendor/noeldemartin/laravel-dusk-mocking/src/MockingProxy.php:50 │ /var/www/emploi2/tests/Browser/UserActionsTest.php:102 │ /var/www/emploi2/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:68 │ /var/www/emploi2/tests/Browser/UserActionsTest.php:114 │
I wondering if I was doing something wrong as Queue have all already a mock as mail ?
Sorry for this post, but now you could mention that queue fork would not be possible. I just found the error : Serialization of 'Closure' is not allowed at .../noeldemartin/laravel-dusk-mocking/src/Driver.php:151)
Have you already have this issue. Is it possible to find a turnaround ?
The text was updated successfully, but these errors were encountered:
This is a known limitation, but I realize I only mentioned it in some comments and it wasn't documented. I've added a new section to the readme explaining those limitations. Make sure to check that out for some workarounds.
As per this issue in particular, it's very similar to #9 and #13. Those were also caused because some Laravel services use closures internally. I'll leave it open and add the "enhancement" label, but I don't expect to work on this anytime soon. Going down this path I'd end up reimplementing all Laravel fakes, and that's a rabbit hole I don't want to get myself into. If anyone wants to give it a shot and open a PR, go ahead!
Thanks for your complete answer. Do't know If I will have time to test other possibilities you mention, but thanks anyway for your hard work on this subject. For queues test, I can test them in the Database, not very usefull but I'am sure that I would find the data there :-)
Hi,
I started to use your package which is extra to mock, and test mails ! Top. But now I would like to mock Laravel Queues and after doing this :
$queue = $browser->fake(Queue::class); [...] $queue->assertNotPushed(SynchrUser::class);
And I get this error :
Browser\UserActions ✘ Register │ │ Exception: Unable to retrieve mock for [Illuminate\Support\Facades\Queue]. │ │ /var/www/emploi2/vendor/noeldemartin/laravel-dusk-mocking/src/MockingProxy.php:50 │ /var/www/emploi2/tests/Browser/UserActionsTest.php:102 │ /var/www/emploi2/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:68 │ /var/www/emploi2/tests/Browser/UserActionsTest.php:114 │
I wondering if I was doing something wrong as Queue have all already a mock as mail ?
Sorry for this post, but now you could mention that queue fork would not be possible. I just found the error :
Serialization of 'Closure' is not allowed at .../noeldemartin/laravel-dusk-mocking/src/Driver.php:151)
Have you already have this issue. Is it possible to find a turnaround ?
The text was updated successfully, but these errors were encountered: