Skip to content

Commit 71526db

Browse files
committed
More test and request class cleanup.
1 parent 8396665 commit 71526db

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

src/Message/DeleteProfileCardRequest.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,6 @@ public function getData()
99
return;
1010
}
1111

12-
public function testSendSuccess()
13-
{
14-
$this->request->setProfileId('8F10Ab54FC434b71972cF2E442c0fb4f');
15-
$this->request->setCardId('1');
16-
$this->setMockHttpResponse('DeleteProfileCardSuccess.txt');
17-
$response = $this->request->send();
18-
$this->assertTrue($response->isSuccessful());
19-
$this->assertSame(1, $response->getCode());
20-
$this->assertSame('Operation Successful', $response->getMessage());
21-
$this->assertSame('8F10Ab54FC434b71972cF2E442c0fb4f', $response->getCustomerCode());
22-
}
23-
24-
public function testSendError()
25-
{
26-
$this->request->setProfileId('8F10Ab54FC434b71972cF2E442c0fb4f');
27-
$this->request->setCardId('1');
28-
$this->setMockHttpResponse('DeleteProfileCardFailure.txt');
29-
$response = $this->request->send();
30-
$this->assertFalse($response->isSuccessful());
31-
$this->assertSame(44, $response->getCode());
32-
$this->assertSame(3, $response->getCategory());
33-
$this->assertSame('Operation failed, no matching card id.', $response->getMessage());
34-
}
35-
3612
public function getEndpoint()
3713
{
3814
return $this->endpoint . '/' . $this->getProfileId() . '/cards/' . $this->getCardId();

src/Message/UpdateProfileCardRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ public function getData()
66
{
77
$this->validate('profile_id');
88
$this->validate('card_id');
9-
return;
9+
return parent::getData();
1010
}
1111

1212
public function getEndpoint()

src/Message/UpdateProfileRequest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
class UpdateProfileRequest extends CreateProfileRequest
44
{
5+
public function getData()
6+
{
7+
$this->validate('profile_id');
8+
return parent::getData();
9+
}
10+
511
public function getEndpoint()
612
{
713
return $this->endpoint . '/' . $this->getProfileId();

tests/Message/UpdateProfileRequestTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public function testBillingAndToken()
9797

9898
public function testCardAndCardBillingAddress()
9999
{
100+
$this->request->setProfileId('9ba60541d32648B1A3581670123dF2Ef');
100101
$billing1 = array(
101102
'name' => 'test mann',
102103
'email_address' => '[email protected]',

0 commit comments

Comments
 (0)