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/omise/omise-php/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/job-board.corals.io/vendor/omise/omise-php/tests/RefundTest.php
<?php

use PHPUnit\Framework\TestCase;
use Omise\Traits\ChargeTrait;

class RefundTest extends TestCase
{
    use ChargeTrait;
    /**
     * @test
     * Assert that a list of refunds object could be successfully retrieved.
     */
    public function retrieve_charge_refund_list_object()
    {
        $charge = $this->createCharge(true);
        $refunds = $charge->refunds();
        $this->assertArrayHasKey('object', $refunds);
        $this->assertEquals('list', $refunds['object']);
    }

    /**
     * @test
     * Assert that a refund is successfully created with the given parameters set.
     */
    public function create()
    {
        $charge = $this->createCharge(true);
        $refunds = $charge->refunds();
        $refund = $refunds->create(['amount' => 10000]);
        $this->assertArrayHasKey('object', $refund);
        $this->assertEquals('refund', $refund['object']);
    }

    /**
     * @test
     * Assert that a refund can be retrieve after created successfully.
     */
    public function retrieve_specific_charge_refund_object()
    {
        $charge = $this->createCharge(true);
        $refunds = $charge->refunds();
        $create = $refunds->create(['amount' => 10000]);
        $refund = $refunds->retrieve($create['id']);
        $this->assertArrayHasKey('object', $refund);
        $this->assertEquals('refund', $refund['object']);
    }

    /**
     * @test
     * Assert that OmiseRefund can search for refunds.
     */
    public function search()
    {
        $result = OmiseRefund::search()
            ->filter(['voided' => true]);
        $this->assertArrayHasKey('object', $result);
        $this->assertEquals('search', $result['object']);
        foreach ($result['data'] as $item) {
            $this->assertArrayHasKey('object', $item);
            $this->assertEquals('refund', $item['object']);
        }
    }
}

Spamworldpro Mini