Testing Laravel (5.1) console commands with phpunit -
what best way test laravel console commands? here example of command i'm running. takes in value in constructor , in handle method. class dosomething extends command { protected $signature = 'app:do-something'; protected $description = 'does something'; public function __construct(a $a) { ... } public function handle(b $b) { ... } } in test class, can mock both , b, can't figure out how pass $a in. $this->artisan('app:do-something', [$b]); is possible? or going wrong? should pass in thought handle() method? thanks. you have change around how call command in testing, possible mock object passed through. if class used artisan dependency-injected this: public function __construct(actualobject $mocked_a) { // } then write test case this: $mocked_a = mockery::mock('actualobject'); $this->app->instance('actualobject', $mocked_a); $kernel = $this...