Summer Sale! All accounts are 50% off this week.

sarunama's avatar

Job Model->saveQuietly() not working on tests

So my application is all working fine and dandy, only my test is broken.

I have a job with Model->saveQuietly(), The job is fired when the model has been saved, so you can see why i used saveQuietly(), so it does not have a infinite loop.

only problem is that in artisan test, there is still a loop...i can confirm this when i comment the saveQuietly() the tests are working agian.

0 likes
2 replies
Nakov's avatar

What about this workaround:

// in the test, call the unset on your instance
$model->unsetEventDispatcher();
$model->save();
sarunama's avatar

Thanks for the reply.

well i solved it, saveQuietly() works, it was some other thing that did not work. as usally.

Please or to participate in this conversation.