public function testCompletePurchaseFailure()
 {
     $this->response = new CompletePurchaseResponse($this->getMockRequest(), array('sessionid' => '123abc', 'errorstatus' => '1', 'authstatus' => '0', 'authcode' => '99', 'errorcode' => '', 'errordescription' => '', 'iasorderno' => '987654'));
     $this->assertFalse($this->response->isSuccessful());
     $this->assertFalse($this->response->isRedirect());
     $this->assertFalse($this->isError());
     $this->assertSame('99', $this->response->getTransactionReference());
     $this->assertSame('987654', $this->response->getTransactionId());
     $this->assertNull($this->response->getMessage());
 }
 public function testFailure()
 {
     $response = new CompletePurchaseResponse($this->getMockRequest(), array('code' => 1, 'invoiceId' => '1', 'shopId' => '123', 'orderNumber' => '5'));
     $this->assertFalse($response->isSuccessful());
     $this->assertFalse($response->isRedirect());
     $this->assertNotNull($response->getMessage());
     $this->assertContains('paymentAvisoResponse', $response->getMessage());
     $this->assertSame('5', $response->getTransactionReference());
 }