I want to test my oauth server (with laravel/passport package).
I use unit tests, I use a memory database with PHPUnit, so I can not migrate the tables created by the package.
I would like to be able to call the following commands in my test:
$this->artisan('passport:client', ['--password' => null, '--no-interaction' => true]);
$this->artisan('passport:keys', ['--no-interaction' => true]);
But, I have this error:
Mockery\Exception\BadMethodCallException: Received Mockery_1_Illuminate_Console_OutputStyle::askQuestion(), but no expectations were specified
I'm sure this is due to the fact that I do not have a fully installed passport but I do not know how to do it.
composer require laravel/passport
php artisan passport:client --password
php artisan passport:keys
Think this is indeed a problem with the latest 5.7 release which adds support for testing commands. Will take a thorough look later but feel free to send in a PR if you figure this out yourself.
public $mockConsoleOutput = false; in my test worked for me as the upgrade guide suggests
@sethphillips is right. I totally missed this. Thanks!
Most helpful comment
public $mockConsoleOutput = false;in my test worked for me as the upgrade guide suggests