![]() 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/ |
<?php use PHPUnit\Framework\TestCase; class OmiseAccountTest extends TestCase { /** * @test * OmiseAccount class must be contain some method below. */ public function method_exists() { $this->assertTrue(method_exists('OmiseAccount', 'retrieve')); $this->assertTrue(method_exists('OmiseAccount', 'update')); $this->assertTrue(method_exists('OmiseAccount', 'reload')); $this->assertTrue(method_exists('OmiseAccount', 'getUrl')); } /** * @test * Assert that an account object is returned after a successful retrieve. */ public function retrieve_omise_account_object() { $account = OmiseAccount::retrieve(); $this->assertArrayHasKey('object', $account); $this->assertEquals('account', $account['object']); } /** * @test * Assert that the account is successfully updated. */ public function update() { $account = OmiseAccount::retrieve(); $account->update(['chain_return_uri' => 'https://www.omise.co']); $this->assertArrayHasKey('object', $account); $this->assertEquals('account', $account['object']); $this->assertEquals('https://www.omise.co', $account['chain_return_uri']); } /** * @test * Assert that an account object is returned after a successful reload. */ public function reload() { $account = OmiseAccount::retrieve(); $account->reload(); $this->assertArrayHasKey('object', $account); $this->assertEquals('account', $account['object']); } }