5 use Omnipay\Tests\TestCase;
7 class ResponseTest
extends TestCase
12 $response =
new Response($this->getMockRequest(),
'example=value&foo=bar');
13 $this->assertEquals(array(
'example' =>
'value',
'foo' =>
'bar'), $response->getData());
18 $httpResponse = $this->getMockHttpResponse(
'ProPurchaseSuccess.txt');
19 $response =
new Response($this->getMockRequest(), $httpResponse->getBody());
21 $this->assertFalse($response->isPending());
22 $this->assertTrue($response->isSuccessful());
23 $this->assertSame(
'96U93778BD657313D', $response->getTransactionReference());
24 $this->assertNull($response->getMessage());
29 $httpResponse = $this->getMockHttpResponse(
'ProPurchaseFailure.txt');
30 $response =
new Response($this->getMockRequest(), $httpResponse->getBody());
32 $this->assertFalse($response->isPending());
33 $this->assertFalse($response->isSuccessful());
34 $this->assertNull($response->getTransactionReference());
35 $this->assertSame(
'This transaction cannot be processed. Please enter a valid credit card expiration year.', $response->getMessage());