public function testPurchaseFailure() { $httpResponse = $this->getMockHttpResponse('ResendEmailFailure.txt'); $response = new Response($this->getMockRequest(), $httpResponse->getBody(), 'somePaymentKey'); /* Check the request details */ $this->assertFalse($response->isSuccessful()); $this->assertNull($response->isVerified()); $this->assertFalse($response->isRedirect()); /* Check the errors */ $this->assertSame('transaction not found', $response->getMessage()); $this->assertSame('11', $response->getErrorCode()); /* Check the transaction details */ $this->assertNull($response->getTransactionReference()); $this->assertNull($response->getExpirationNotice()); $this->assertNull($response->getPaymentSlipLink()); $this->assertNull($response->getInfoText1()); $this->assertNull($response->getInfoText2()); $this->assertNull($response->getRefundTransactionId()); $this->assertNull($response->getOriginTransactionId()); $this->assertNull($response->getHash()); /* Check the additional data */ $this->assertNotNull($response->getRaw()); }