/** * @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\Flow\Cli\CommandManager::class); $mockCommandManager->expects($this->any())->method('getCommandByIdentifier')->with('test:default:list')->will($this->throwException(new \TYPO3\Flow\Mvc\Exception\NoSuchCommandException())); $this->requestBuilder->injectCommandManager($mockCommandManager); $request = $this->requestBuilder->build('test:default:list'); $this->assertSame(\TYPO3\Flow\Command\HelpCommandController::class, $request->getControllerObjectName()); }