Kraken\_Unit\Console\Server\Command\Project\ProjectStatusCommandTest::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']);
        $channel = $this->createChannel();
        $config = $this->createConfig(['main.alias' => 'main']);
        $command->expects($this->atLeastOnce())->method('createRequest')->with($channel, 'main', $this->isInstanceOf(RuntimeCommand::class))->will($this->returnValue($mock));
        $result = $this->callProtectedMethod($command, 'command', []);
        $expect = $this->createCallableMock();
        $expect->expects($this->once())->method('__invoke');
        $result->then($expect);
    }