/** * @test */ public function ifCommandCantBeResolvedTheHelpScreenIsShown() { // The following call is only made to satisfy PHPUnit. For some weird reason PHPUnit complains that the // mocked method ("getObjectNameByClassName") does not exist _if the mock object is not used_. $this->mockObjectManager->getObjectNameByClassName('Acme\\Test\\Command\\DefaultCommandController'); $this->mockCommandManager->getCommandByIdentifier('acme.test:default:list'); $mockCommandManager = $this->getMock('TYPO3\\FLOW3\\Cli\\CommandManager'); $mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('test:default:list')->will($this->throwException(new \TYPO3\FLOW3\Mvc\Exception\NoSuchCommandException())); $this->requestBuilder->injectCommandManager($mockCommandManager); $request = $this->requestBuilder->build('test:default:list'); $this->assertSame('TYPO3\\FLOW3\\Command\\HelpCommandController', $request->getControllerObjectName()); }