testDouble( Command::class, mockObject: false, callOriginalConstructor: false, callOriginalClone: false, ); $command->method('getName')->willReturn($name); $command->method('isEnabled')->willReturn(true); $command->method('getAliases')->willReturn([]); $command->method('getDefinition')->willReturn(new InputDefinition()); return $command; } public static function testerForCommand(Command $mainCommand, Command ...$extraCommands): CommandTester { $app = new Application(); $app->addCommand($mainCommand); foreach ($extraCommands as $command) { $app->addCommand($command); } return new CommandTester($mainCommand); } }