Skip to content

Commit afa334d

Browse files
committed
Add gateway method tests
1 parent be14742 commit afa334d

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

tests/GatewayTest.php

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
class GatewayTest extends GatewayTestCase
99
{
10+
/**
11+
* @var Gateway
12+
*/
13+
protected $gateway;
14+
1015
public function setUp()
1116
{
1217
parent::setUp();
@@ -19,4 +24,49 @@ public function setUp()
1924
);
2025
}
2126

27+
public function testAuthorize()
28+
{
29+
$request = $this->gateway->authorize(array('amount' => '10.00'));
30+
$this->assertInstanceOf('Omnipay\Braintree\Message\AuthorizeRequest', $request);
31+
$this->assertSame('10.00', $request->getAmount());
32+
}
33+
34+
public function testCapture()
35+
{
36+
$request = $this->gateway->capture(array('amount' => '10.00'));
37+
$this->assertInstanceOf('Omnipay\Braintree\Message\CaptureRequest', $request);
38+
$this->assertSame('10.00', $request->getAmount());
39+
}
40+
41+
public function testPurchase()
42+
{
43+
$request = $this->gateway->purchase(array('amount' => '10.00'));
44+
$this->assertInstanceOf('Omnipay\Braintree\Message\PurchaseRequest', $request);
45+
$this->assertSame('10.00', $request->getAmount());
46+
}
47+
48+
public function testRefund()
49+
{
50+
$request = $this->gateway->refund(array('amount' => '10.00'));
51+
$this->assertInstanceOf('Omnipay\Braintree\Message\RefundRequest', $request);
52+
$this->assertSame('10.00', $request->getAmount());
53+
}
54+
55+
public function testVoid()
56+
{
57+
$request = $this->gateway->void();
58+
$this->assertInstanceOf('Omnipay\Braintree\Message\VoidRequest', $request);
59+
}
60+
61+
public function testFind()
62+
{
63+
$request = $this->gateway->find(array());
64+
$this->assertInstanceOf('Omnipay\Braintree\Message\FindRequest', $request);
65+
}
66+
67+
public function testClientToken()
68+
{
69+
$request = $this->gateway->clientToken(array());
70+
$this->assertInstanceOf('Omnipay\Braintree\Message\ClientTokenRequest', $request);
71+
}
2272
}

0 commit comments

Comments
 (0)