|
Server : Apache System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : matalashes ( 1004) PHP Version : 8.1.29 Disable Function : NONE Directory : /home/matalashes/www/kite.mata-lashes.com/vendor/xendit/xendit-php/tests/Xendit/ |
Upload File : |
<?php
/**
* BalanceTest.php
* php version 7.2.0
*
* @category Test
* @package Xendit
* @author Ellen <ellen@xendit.co>
* @license https://opensource.org/licenses/MIT MIT License
* @link https://api.xendit.co
*/
namespace Xendit;
use Xendit\Balance;
use Xendit\TestCase;
/**
* Class BalanceTest
*
* @category Class
* @package Xendit
* @author Ellen <ellen@xendit.co>
* @license https://opensource.org/licenses/MIT MIT License
* @link https://api.xendit.co
*/
class BalanceTest extends TestCase
{
const ACCOUNT_TYPE = 'CASH';
const AMOUNT = 100000;
/**
* Get Balance test
* Should pass
*
* @return void
* @throws Exceptions\ApiException
*/
public function testIsGettable()
{
$this->stubRequest(
'get',
'/balance?account_type=' . self::ACCOUNT_TYPE,
[],
[],
[
'balance' => self::AMOUNT
]
);
$result = Balance::getBalance(self::ACCOUNT_TYPE);
$this->assertEquals($result['balance'], self::AMOUNT);
}
/**
* Get Balance test
* Should throw ApiException
*
* @return void
* @throws Exceptions\InvalidArgumentException
* @throws Exceptions\ApiException
*/
public function testIsGettableThrowInvalidArgumentException()
{
$this->expectException(\Xendit\Exceptions\InvalidArgumentException::class);
Balance::getBalance();
}
}