Why I'm getting errors while trying to run tests with jobs in Laravel

Viewed 62

I have a route which updates user email and creates an event. This event has only one listener subscribed. This listener implements ShouldQueue interface. Everything is working fine except tests. When I'm running tests I'm getting this as a result

serialize(): __sleep should return an array only containing the names of instance-variables to serialize {"userId":71,"exception":"[object] (ErrorException(code: 0): serialize(): __sleep should return an array only containing the names of instance-variables to serialize at /var/www/app_name/vendor/laravel/framework/src/Illuminate/Queue/Queue.php:158)

and a stacktrace here

enter image description here

Is it possible to fix somehow?

0 Answers
Related