prophesize(Command::class); $command->getName()->willReturn($name); $command->getDefinition()->willReturn($name); $command->isEnabled()->willReturn(true); $command->getAliases()->willReturn([]); $command->setApplication(Argument::type(Application::class))->willReturn(function (): void { }); return $command; } private function testerForCommand(Command $mainCommand, Command ...$extraCommands): CommandTester { $app = new Application(); $app->add($mainCommand); foreach ($extraCommands as $command) { $app->add($command); } return new CommandTester($mainCommand); } }