Skip to content

Commit 086cd47

Browse files
author
Hugo Vacher
committed
Add unit test
1 parent 02d7df2 commit 086cd47

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/ProGatewayTest.php

+20
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,26 @@ public function testReferencePurchaseSuccess()
8686
$this->assertEquals('A10A6AE7042E', $response->getTransactionReference());
8787
}
8888

89+
public function testReferencePurchaseWithCvvSuccess()
90+
{
91+
$options = array(
92+
'amount' => '10.00',
93+
'cardReference' => 'abc123',
94+
'card' => new CreditCard(array(
95+
'cvv' => '123',
96+
)),
97+
);
98+
99+
$this->setMockHttpResponse('PurchaseSuccess.txt');
100+
101+
$request = $this->gateway->purchase($options);
102+
$response = $request->send();
103+
104+
$this->assertArrayHasKey('CVV2', $request->getData());
105+
$this->assertTrue($response->isSuccessful());
106+
$this->assertEquals('A10A6AE7042E', $response->getTransactionReference());
107+
}
108+
89109
public function testPurchaseError()
90110
{
91111
$this->setMockHttpResponse('PurchaseFailure.txt');

0 commit comments

Comments
 (0)