Skip to content

Commit

Permalink
Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashish committed Oct 16, 2023
1 parent 838d1f6 commit 3ba8a92
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/unit/class-omise-util-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public function get_platform_type__osx_desktop()
$this->assertEquals( $expectedOutput, Omise_Util::get_platform_type( $userAgent ) );
}

/**
* @runInSeparateProcess
*/
public function test_get_webhook_url()
{
if (!function_exists('get_rest_url')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function setUp(): void
$setting->shouldReceive('instance')
->andReturn($setting);
$setting->shouldReceive('is_dynamic_webhook_enabled')
->andReturn(false);
->andReturn(true);

$redirectUrlMock = Mockery::mock('alias:RedirectUrl');
$redirectUrlMock->shouldReceive('create')
Expand Down Expand Up @@ -65,14 +65,20 @@ public function getOrderMock($expectedAmount, $expectedCurrency)
/**
* @runInSeparateProcess
*/
public function testPrepareChargeData()
public function testCharge()
{
if (!function_exists('wc_clean')) {
function wc_clean() {
return 'tokn_123';
}
}

if (!function_exists('get_rest_url')) {
function get_rest_url() {
return 'https://abc.com/wp-json/omise/webhooks';
}
}

$expectedAmount = 99999;
$expectedCurrency = 'thb';
$expectedChargeResponse = [
Expand Down

0 comments on commit 3ba8a92

Please sign in to comment.