/** * @test */ public function getAvailableCommandsReturnsAllAvailableCommands() { $commandManager = new CommandManager(); $commandManager->injectReflectionService($this->mockReflectionService); $mockCommandControllerClassNames = array('TYPO3\\FLOW3\\Tests\\Unit\\Cli\\Fixtures\\Command\\MockACommandController', 'TYPO3\\FLOW3\\Tests\\Unit\\Cli\\Fixtures\\Command\\MockBCommandController'); $this->mockReflectionService->expects($this->once())->method('getAllSubClassNamesForClass')->with('TYPO3\\FLOW3\\Cli\\CommandController')->will($this->returnValue($mockCommandControllerClassNames)); $commands = $commandManager->getAvailableCommands(); $this->assertEquals(3, count($commands)); $this->assertEquals('typo3.flow3.tests.unit.cli.fixtures:mocka:foo', $commands[0]->getCommandIdentifier()); $this->assertEquals('typo3.flow3.tests.unit.cli.fixtures:mocka:bar', $commands[1]->getCommandIdentifier()); $this->assertEquals('typo3.flow3.tests.unit.cli.fixtures:mockb:baz', $commands[2]->getCommandIdentifier()); }
/** * @return void */ protected function displayHelpIndex() { $context = $this->bootstrap->getContext(); $this->outputLine('<b>FLOW3 %s ("%s" context)</b>', array($this->packageManager->getPackage('TYPO3.FLOW3')->getPackageMetaData()->getVersion(), $context)); $this->outputLine('<i>usage: %s <command identifier></i>', array($this->getFlow3InvocationString())); $this->outputLine(); $this->outputLine('The following commands are currently available:'); $this->displayShortHelpForCommands($this->commandManager->getAvailableCommands()); $this->outputLine('* = compile time command'); $this->outputLine(); $this->outputLine('See "%s help <commandidentifier>" for more information about a specific command.', array($this->getFlow3InvocationString())); $this->outputLine(); }