Skip to content

Commit

Permalink
Adding testToken to CreateProfileRequestTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
aperdomo committed Mar 22, 2016
1 parent dcb1c38 commit a0a8fe3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Message/CreateProfileRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ class CreateProfileRequest extends AbstractProfileRequest
{
public function getData()
{
$this->getCard()->validate();

$data = array(
'language' => $this->getLanguage(),
'comment' => $this->getComment(),
'billing' => $this->getBilling()
);

if ($this->getCard()) {
$this->getCard()->validate();

$data['card'] = array(
'number' => $this->getCard()->getNumber(),
'name' => $this->getCard()->getName(),
Expand Down
13 changes: 13 additions & 0 deletions tests/Message/CreateProfileRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ public function testBilling()
$this->assertSame($billing, $this->request->getBilling());
}

public function testToken()
{
$token = array(
'name' => 'token-test-name',
'code' => 'token-test-code'
);

$this->assertSame($this->request, $this->request->setToken($token));
$this->assertSame($token, $this->request->getToken());
$data = $this->request->getData();
$this->assertSame($token, $data['token']);
}

public function testBillingAndToken()
{
$billing = array(
Expand Down

0 comments on commit a0a8fe3

Please sign in to comment.