Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/job-board.corals.io/vendor/xendit/xendit-php/tests/Xendit/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/job-board.corals.io/vendor/xendit/xendit-php/tests/Xendit/BalanceTest.php
<?php

/**
 * BalanceTest.php
 * php version 7.2.0
 *
 * @category Test
 * @package  Xendit
 * @author   Ellen <[email protected]>
 * @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 <[email protected]>
 * @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();
    }
}

Spamworldpro Mini