Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Vacher committed Feb 27, 2018
1 parent 02d7df2 commit 086cd47
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/ProGatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@ public function testReferencePurchaseSuccess()
$this->assertEquals('A10A6AE7042E', $response->getTransactionReference());
}

public function testReferencePurchaseWithCvvSuccess()
{
$options = array(
'amount' => '10.00',
'cardReference' => 'abc123',
'card' => new CreditCard(array(
'cvv' => '123',
)),
);

$this->setMockHttpResponse('PurchaseSuccess.txt');

$request = $this->gateway->purchase($options);
$response = $request->send();

$this->assertArrayHasKey('CVV2', $request->getData());
$this->assertTrue($response->isSuccessful());
$this->assertEquals('A10A6AE7042E', $response->getTransactionReference());
}

public function testPurchaseError()
{
$this->setMockHttpResponse('PurchaseFailure.txt');
Expand Down

0 comments on commit 086cd47

Please sign in to comment.