Support the ongoing development of Laravel.io →
posted 10 years ago
Testing
Last updated 2 years ago.
0

This was discussed in https://github.com/laravel/framework/issues/1181 but that is no longer there now :(.

My solution involved using:

Model::flushEventListeners(); Model::boot();

before each test. If you are only flushing the listeners I would expect it to not work.

How you do this is up to you. I just ended up putting it in __before() but I havent needed to copy that into very many tests yet.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

CedNet cednet Joined 16 Dec 2013

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.