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

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

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