Neos\Flow\Tests\Unit\Cli\CommandManagerTest::getCommandByIdentifierThrowsExceptionIfMoreThanOneMatchingCommandWasFound PHP Метод

getCommandByIdentifierThrowsExceptionIfMoreThanOneMatchingCommandWasFound() публичный Метод

    public function getCommandByIdentifierThrowsExceptionIfMoreThanOneMatchingCommandWasFound()
    {
        $mockCommand1 = $this->getMockBuilder(Cli\Command::class)->disableOriginalConstructor()->getMock();
        $mockCommand1->expects($this->once())->method('getCommandIdentifier')->will($this->returnValue('package.key:controller:command'));
        $mockCommand2 = $this->getMockBuilder(Cli\Command::class)->disableOriginalConstructor()->getMock();
        $mockCommand2->expects($this->once())->method('getCommandIdentifier')->will($this->returnValue('otherpackage.key:controller:command'));
        $mockCommands = [$mockCommand1, $mockCommand2];
        $this->commandManager->expects($this->once())->method('getAvailableCommands')->will($this->returnValue($mockCommands));
        $this->commandManager->getCommandByIdentifier('controller:command');
    }