public function testCompletePurchaseErrorWithMessage() { $this->response = new CompletePurchaseResponse($this->getMockRequest(), array('sessionid' => '123abc', 'errorstatus' => '0', 'authstatus' => '', 'authcode' => '', 'errorcode' => '50', 'errordescription' => 'Something wrong', 'iasorderno' => '987654')); $this->assertFalse($this->response->isSuccessful()); $this->assertFalse($this->response->isRedirect()); $this->assertTrue($this->isError()); $this->assertSame('Something wrong', $this->response->getMessage()); $this->assertSame('987654', $this->response->getTransactionId()); }
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()); }