public function testDoubleInvalidResponse() { $this->webClient->expects($this->exactly(2))->method('makeRequest')->with(new Paysera_WalletApi_Http_Request(''))->will($this->returnValue(new Paysera_WalletApi_Http_Response(502, array(), '<html> <head><title>502 Bad Gateway</title></head> <body bgcolor="white"> <center><h1>502 Bad Gateway</h1></center> <hr><center>nginx/1.0.15</center> </body> </html> '))); $this->setExpectedException('Paysera_WalletApi_Exception_ResponseException'); $this->service->makeRequest(new Paysera_WalletApi_Http_Request('')); }
/** * * @param string $data * @param string $sign * @param string $publicKey * * @dataProvider invalidDataProvider */ public function testCheckSignWithInvalid($data, $sign, $publicKey) { $this->webClient->expects($this->once())->method('makeRequest')->with(new Paysera_WalletApi_Http_Request('http://publickey.abc'))->will($this->returnValue(new Paysera_WalletApi_Http_Response(200, array(), $publicKey))); $this->assertFalse($this->service->checkSign($data, $sign)); }