Skip to content

Commit 5987e13

Browse files
committed
Update ResponseTest.php
1 parent 90209a3 commit 5987e13

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/Omnipay/Stripe/Message/ResponseTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@ public function testStoreFailure()
6262
$this->assertNull($response->getCardReference());
6363
$this->assertSame('You must provide an integer value for \'exp_year\'.', $response->getMessage());
6464
}
65+
66+
public function testUpdateSuccess()
67+
{
68+
$httpResponse = $this->getMockHttpResponse('UpdateSuccess.txt');
69+
$response = new Response($this->getMockRequest(), $httpResponse->json());
70+
71+
$this->assertTrue($response->isSuccessful());
72+
$this->assertFalse($response->isRedirect());
73+
$this->assertNull($response->getTransactionReference());
74+
$this->assertSame('cus_1MZSEtqSghKx99', $response->getCardReference());
75+
$this->assertNull($response->getMessage());
76+
}
77+
78+
public function testUpdateFailure()
79+
{
80+
$httpResponse = $this->getMockHttpResponse('UpdateFailure.txt');
81+
$response = new Response($this->getMockRequest(), $httpResponse->json());
82+
83+
$this->assertFalse($response->isSuccessful());
84+
$this->assertFalse($response->isRedirect());
85+
$this->assertNull($response->getTransactionReference());
86+
$this->assertNull($response->getCardReference());
87+
$this->assertSame('No such customer: cus_1MZeNih5LdKxDq', $response->getMessage());
88+
}
6589

6690
public function testUnstoreSuccess()
6791
{

0 commit comments

Comments
 (0)