-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test coverage for get_balance changes.
- Loading branch information
Colin Campbell
committed
Feb 25, 2016
1 parent
b85152c
commit c70929f
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
|
||
use opensrs\account\GetBalance; | ||
|
||
/** | ||
* @group account | ||
* @group GetBalance | ||
*/ | ||
class integrationGetBalanceTest extends PHPUnit_Framework_TestCase | ||
{ | ||
protected $func = 'accountGetBalance'; | ||
protected $getBalance; | ||
protected $responseData; | ||
|
||
public function setUp() | ||
{ | ||
$this->getBalance = new GetBalance('array', array()); | ||
$this->responseData = $this->getBalance->resultFullRaw; | ||
} | ||
|
||
|
||
/** | ||
* Response should return a 200 | ||
* | ||
*/ | ||
public function testResponseSuccess() | ||
{ | ||
// response code exists | ||
$this->assertTrue(array_key_exists('response_code', $this->responseData)); | ||
|
||
// respose code is 200 | ||
$this->assertEquals($this->responseData['response_code'], '200'); | ||
} | ||
|
||
/** | ||
* Response sshould have a balance | ||
* | ||
*/ | ||
public function testResponseHasBalance() | ||
{ | ||
// attributes array exists | ||
$this->assertTrue(array_key_exists('attributes', $this->responseData)); | ||
|
||
// has balance | ||
$this->assertTrue(array_key_exists('balance', $this->responseData['attributes'])); | ||
} | ||
|
||
/** | ||
* Response should have a hold balance | ||
* | ||
*/ | ||
public function testResponesHasHoldBalance() | ||
{ | ||
// attributes array exists | ||
$this->assertTrue(array_key_exists('attributes', $this->responseData)); | ||
|
||
// has hold balance | ||
$this->assertTrue(array_key_exists('hold_balance', $this->responseData['attributes'])); | ||
} | ||
} |