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/TransactionTest.php
<?php

/**
 * TransactionTest.php
 * php version 7.4.0
 *
 * @category Test
 * @package  Xendit
 * @author   David <[email protected]>
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     https://api.xendit.co
 */

namespace Xendit;

use Xendit\Transaction;
use Xendit\TestCase;

/**
 * Class TransactionTest
 *
 * @category Class
 * @package  Xendit
 * @author   David <[email protected]>
 * @license  https://opensource.org/licenses/MIT MIT License
 * @link     https://api.xendit.co
 */
class TransactionTest extends TestCase
{
    /**
     * Get list of transactions test
     * Should pass
     *
     * @return void
     * @throws Exceptions\ApiException
     */
    public function testListIsGettable()
    {
        $expectedResponse = [
            'has_more' => false
        ];

        $this->stubRequest(
            'GET',
            '/transactions',
            [],
            [],
            $expectedResponse
        );

        $result = Transaction::list();
        $this->assertEquals($result['has_more'], $expectedResponse['has_more']);
    }

    /**
     * Get detail of transactions test
     * Should pass
     *
     * @return void
     * @throws Exceptions\ApiException
     */
    public function testDetailIsGettable()
    {
        $expectedResponse = [
            'id' => 'txn_4b401a5f-47b1-4aab-8136-f7c4440d571f'
        ];

        $this->stubRequest(
            'GET',
            '/transactions/txn_4b401a5f-47b1-4aab-8136-f7c4440d571f',
            [],
            [],
            $expectedResponse
        );

        $result = Transaction::detail('txn_4b401a5f-47b1-4aab-8136-f7c4440d571f');
        $this->assertEquals($result['id'], $expectedResponse['id']);
    }

    /**
     * Get list of transactions test
     * Should throw ApiException
     *
     * @return void
     */
    public function testListIsGettableThrowsException()
    {
        $this->expectException(\Xendit\Exceptions\ApiException::class);
        Transaction::list();
    }

    /**
     * Get detail of transactions test
     * Should throw ApiException
     *
     * @return void
     */
    public function testDetailIsGettableThrowsException()
    {
        $this->expectException(\Xendit\Exceptions\ApiException::class);
        Transaction::detail('txn_4b401a5f-47b1-4aab-8136-f7c4440d571f');
    }
}

Spamworldpro Mini