To prevent events firing while running tests, which may have side-effects, use the withoutEvents
helper method:
// Inside test code
$this->withoutEvents();
Laravel also provides a way to fake events. Laravel News has coverage of both options.
To prevent events firing while running tests, which may have side-effects, use the withoutEvents
helper method:
// Inside test code
$this->withoutEvents();
Laravel also provides a way to fake events. Laravel News has coverage of both options.