setLaravel(new Application); $repo->shouldReceive('setSource')->once()->with('foo'); $repo->shouldReceive('createRepository')->once(); $this->runCommand($command, ['--database' => 'foo']); } protected function runCommand($command, $options = []) { return $command->run(new ArrayInput($options), new NullOutput); } }