'customTestCommand' ]; $this->assertEquals('Command "customTestCommand" is not defined.', $this->runCommand($input)); } /** * @test */ public function custom_command_exists_when_added() { $this->extend( (new Extend\Console()) ->command(CustomCommand::class) ); $input = [ 'command' => 'customTestCommand' ]; $this->assertEquals('Custom Command.', $this->runCommand($input)); } } class CustomCommand extends AbstractCommand { /** * {@inheritdoc} */ protected function configure() { $this->setName('customTestCommand'); } /** * {@inheritdoc} */ protected function fire() { $this->info('Custom Command.'); } }