Skip to content

Commit 23c1529

Browse files
committed
Update GatewayTest.php
1 parent 5987e13 commit 23c1529

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/Omnipay/Stripe/GatewayTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public function setUp()
3636
$this->storeOptions = array(
3737
'card' => $this->getValidCard(),
3838
);
39+
40+
$this->updateOptions = array(
41+
'cardReference' => 'cus_1MZSEtqSghKx99',
42+
);
3943

4044
$this->unstoreOptions = array(
4145
'cardReference' => 'cus_1MZSEtqSghKx99',
@@ -113,6 +117,30 @@ public function testStoreFailure()
113117
$this->assertNull($response->getCardReference());
114118
$this->assertSame('You must provide an integer value for \'exp_year\'.', $response->getMessage());
115119
}
120+
121+
public function testUpdateSuccess()
122+
{
123+
$this->setMockHttpResponse('UpdateSuccess.txt');
124+
$response = $this->gateway->store($this->storeOptions)->send();
125+
126+
$this->assertTrue($response->isSuccessful());
127+
$this->assertFalse($response->isRedirect());
128+
$this->assertNull($response->getTransactionReference());
129+
$this->assertSame('cus_1MZSEtqSghKx99', $response->getCardReference());
130+
$this->assertNull($response->getMessage());
131+
}
132+
133+
public function testUpdateFailure()
134+
{
135+
$this->setMockHttpResponse('UpdateFailure.txt');
136+
$response = $this->gateway->store($this->storeOptions)->send();
137+
138+
$this->assertFalse($response->isSuccessful());
139+
$this->assertFalse($response->isRedirect());
140+
$this->assertNull($response->getTransactionReference());
141+
$this->assertNull($response->getCardReference());
142+
$this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage());
143+
}
116144

117145
public function testUnstoreSuccess()
118146
{

0 commit comments

Comments
 (0)