ImboUnitTest\EventListener\AccessTokenTest::testThrowsExceptionOnIncorrectToken PHP Метод

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

public testThrowsExceptionOnIncorrectToken ( $url, $token, $privateKey, $correct )
    public function testThrowsExceptionOnIncorrectToken($url, $token, $privateKey, $correct)
    {
        if (!$correct) {
            $this->setExpectedException('Imbo\\Exception\\RuntimeException', 'Incorrect access token', 400);
        }
        $this->query->expects($this->once())->method('has')->with('accessToken')->will($this->returnValue(true));
        $this->query->expects($this->once())->method('get')->with('accessToken')->will($this->returnValue($token));
        $this->request->expects($this->atLeastOnce())->method('getRawUri')->will($this->returnValue(urldecode($url)));
        $this->request->expects($this->atLeastOnce())->method('getUriAsIs')->will($this->returnValue($url));
        $this->accessControl->expects($this->once())->method('getPrivateKey')->will($this->returnValue($privateKey));
        $this->listener->checkAccessToken($this->event);
    }