Noticed an issue when running our legacy tests that when logic fires both events and dispatches queue jobs: the event listeners will not fire if there are calls for expecting queue jobs.
Example:
1) event should fire with non-queued listener to update additional fields
2) more logic happens, eventually the desired state is achieved
3) an queue job is dispatched to do something with this state (email, sms, push...)
Test:
1) we need to let the events & listeners propagate to ensure the correct state is achieved and just want to assert that the (email, sms, push, ...) job is dispatched so we use the $this->expectsJobs(...)
2) when running the tests, the event fire happens but the listeners do not run
Since there are changes with how events are "fired" using the "dispatch" method in the migration from Laravel 5.3 to 5.4, this may not be fixable but i thought i would bring it up since the laravel documentation states that the BrowserKitTestCase is fully backwards compatible
Noticed an issue when running our legacy tests that when logic fires both events and dispatches queue jobs: the event listeners will not fire if there are calls for expecting queue jobs.
Example:
1) event should fire with non-queued listener to update additional fields 2) more logic happens, eventually the desired state is achieved 3) an queue job is dispatched to do something with this state (email, sms, push...)
Test:
1) we need to let the events & listeners propagate to ensure the correct state is achieved and just want to assert that the (email, sms, push, ...) job is dispatched so we use the
$this->expectsJobs(...)
2) when running the tests, the event fire happens but the listeners do not runSince there are changes with how events are "fired" using the "dispatch" method in the migration from Laravel 5.3 to 5.4, this may not be fixable but i thought i would bring it up since the laravel documentation states that the BrowserKitTestCase is fully backwards compatible