Kraken\_Unit\Network\Http\Component\Router\HttpRouterTest::testApiHandleMessage_HandlesError_WhenHttpRequestReceived_ButHandleConnectThrowsException PHP Метод

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

    public function testApiHandleMessage_HandlesError_WhenHttpRequestReceived_ButHandleConnectThrowsException()
    {
        $conn = $this->getMock(NetworkConnection::class, [], [], '', false);
        $mssg = $this->createPassableMessage();
        $server = $this->createServer();
        $router = $this->createRouter($server);
        $component = $this->createComponent();
        $component->expects($this->once())->method('handleConnect')->will($this->throwException($ex = new Exception()));
        $component->expects($this->once())->method('handleError')->with($conn, $ex);
        $matcher = $this->createMatcher(['match']);
        $matcher->expects($this->once())->method('match')->will($this->returnValue(['_controller' => $component]));
        $router->handleMessage($conn, $mssg);
    }
HttpRouterTest