Kraken\_Unit\Runtime\Command\Arch\ArchStartCommandTest::testApiCommand_InvokesProperAction PHP Метод

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

    public function testApiCommand_InvokesProperAction()
    {
        $mock = $this->getMock(Request::class, [], [], '', false);
        $mock->expects($this->any())->method('call')->will($this->returnCallback(function () {
            return new PromiseFulfilled('ok');
        }));
        $command = $this->createCommand([], ['createRequest']);
        $command->expects($this->atLeastOnce())->method('createRequest')->will($this->returnValue($mock));
        $channel = $this->createChannel();
        $runtime = $this->createRuntime(['start']);
        $runtime->expects($this->once())->method('start')->will($this->returnValue(new PromiseFulfilled('')));
        $manager = $this->createManager();
        $manager->expects($this->atLeastOnce())->method('getRuntimes')->will($this->returnValue(new PromiseFulfilled(['alias1'])));
        $result = $this->callProtectedMethod($command, 'command', []);
        $expect = $this->createCallableMock();
        $expect->expects($this->once())->method('__invoke');
        $result->then($expect);
    }