You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the 5.3.19 update, some of my tests which implies events and artisan calls have errors. This appends because the App\Console\Kernel::commands() method execute the base_path('routes/console.php') file, in which there is an Artisan::command() call by default, which leads us to Illuminate\Foundation\Console\Kernel::command() in which there is (finally) a $this->app['events']->listen() instruction. But when using, in tests, $this->withoutEvents() (from the MockApplicationServices trait), the mock created here lacks of this listen() method.
Adding a $mock->shouldReceive('listen'); instruction in this method solve the issue. But since I am not sure how deep it can go, so I choose to write an issue instead of creating a PR.
Steps To Reproduce:
Write a test with $this->withoutEvents() and an artisan call, leaving the default routes/console.php file content.
The text was updated successfully, but these errors were encountered:
Description:
Since the 5.3.19 update, some of my tests which implies events and artisan calls have errors. This appends because the
App\Console\Kernel::commands()
method execute thebase_path('routes/console.php')
file, in which there is anArtisan::command()
call by default, which leads us toIlluminate\Foundation\Console\Kernel::command()
in which there is (finally) a$this->app['events']->listen()
instruction. But when using, in tests,$this->withoutEvents()
(from theMockApplicationServices
trait), the mock created here lacks of thislisten()
method.Adding a
$mock->shouldReceive('listen');
instruction in this method solve the issue. But since I am not sure how deep it can go, so I choose to write an issue instead of creating a PR.Steps To Reproduce:
Write a test with
$this->withoutEvents()
and an artisan call, leaving the defaultroutes/console.php
file content.The text was updated successfully, but these errors were encountered: