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

use PHPUnit\Framework\TestCase;

class TokenTest extends TestCase
{
    /**
     * @test
     * OmiseToken should contain some method like below.
     */
    public function method_exists()
    {
        $this->assertTrue(method_exists('OmiseToken', 'retrieve'));
        $this->assertTrue(method_exists('OmiseToken', 'create'));
        $this->assertTrue(method_exists('OmiseToken', 'reload'));
        $this->assertTrue(method_exists('OmiseToken', 'getUrl'));
    }

    /**
     * @test
     * Assert that a token is successfully created with the given parameters set.
     */
    public function create()
    {
        $token = OmiseToken::create([
            'card' => [
                'name' => 'Zin Kyaw Kyaw',
                'number' => '4242424242424242',
                'expiration_month' => 10,
                'expiration_year' => date('Y', strtotime('+2 years')),
                'city' => 'Bangkok',
                'postal_code' => '10320',
                'security_code' => 123
            ]
        ]);
        $this->assertArrayHasKey('object', $token);
        $this->assertEquals('token', $token['object']);
    }

    /**
     * @test
     * Assert that a token object is returned after a successful retrieve.
     */
    public function retrieve()
    {
        $token = OmiseToken::create([
            'card' => [
                'name' => 'Zin Kyaw Kyaw',
                'number' => '4242424242424242',
                'expiration_month' => 10,
                'expiration_year' => date('Y', strtotime('+2 years')),
                'city' => 'Bangkok',
                'postal_code' => '10320',
                'security_code' => 123
            ]
        ]);
        $token = OmiseToken::retrieve($token['id']);
        $this->assertArrayHasKey('object', $token);
        $this->assertEquals('token', $token['object']);
    }

    /**
    * @test
    * Assert that a token object is returned after a successful reload.
    */
    public function reload()
    {
        $token = OmiseToken::create([
            'card' => [
                'name' => 'Zin Kyaw Kyaw',
                'number' => '4242424242424242',
                'expiration_month' => 10,
                'expiration_year' => date('Y', strtotime('+2 years')),
                'city' => 'Bangkok',
                'postal_code' => '10320',
                'security_code' => 123
            ]
        ]);
        $token->reload();
        $this->assertArrayHasKey('object', $token);
        $this->assertEquals('token', $token['object']);
    }
}

Spamworldpro Mini