Skip to content

Commit

Permalink
Add integration test coverage for get_balance changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Campbell committed Feb 25, 2016
1 parent b85152c commit c70929f
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions tests/integration/opensrs/account/GetBalanceTest.php
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']));
}
}

0 comments on commit c70929f

Please sign in to comment.