![]() 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 SourceTest extends TestCase { /** * @test * OmiseSource class must be contain some method below. */ public function method_exists() { $this->assertTrue(method_exists('OmiseSource', 'retrieve')); $this->assertTrue(method_exists('OmiseSource', 'create')); } /** * @test * Assert that creating source return successfully with correct response */ public function create() { $parameter = [ 'type' => 'bill_payment_tesco_lotus', 'amount' => 15000, 'currency' => 'thb' ]; $source = OmiseSource::create($parameter); $this->assertArrayHasKey('object', $source); $this->assertEquals('source', $source['object']); } /** * @test * Assert that retrieving source return successfully with correct response */ public function retrieve_specifics_source_object() { $parameter = [ 'type' => 'bill_payment_tesco_lotus', 'amount' => 15000, 'currency' => 'thb' ]; $source = OmiseSource::create($parameter); $source = OmiseSource::retrieve($source['id']); $this->assertArrayHasKey('object', $source); $this->assertEquals('source', $source['object']); } }