Skip to content

Commit

Permalink
updated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aashish committed Oct 12, 2023
1 parent 33619ef commit 72c52d4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 0 additions & 3 deletions tests/unit/class-omise-util-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ 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
9 changes: 3 additions & 6 deletions tests/unit/includes/gateway/bootstrap-test-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ function wp_kses() {}
if (!function_exists('add_action')) {
function add_action() {}
}

if (!function_exists('sanitize_text_field')) {
function sanitize_text_field() {
return 'Sanitized text';
}
}
}

public function getOrderMock($expectedAmount, $expectedCurrency)
Expand Down Expand Up @@ -66,6 +60,9 @@ public function tearDown(): void
Mockery::close();
}

/**
* @runInSeparateProcess
*/
public function getChargeTest($classObj)
{
$expectedAmount = 999999;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ public function setUp(): void

public function testCharge()
{
if (!function_exists('sanitize_text_field')) {
function sanitize_text_field() {
return 'Sanitized text';
}
}

$_POST['source'] = ['bank' => 'SCB'];
$obj = new Omise_Payment_DuitNow_OBW();
$this->getChargeTest($obj);
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/includes/gateway/class-omise-payment-fpx-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public function setUp(): void

public function testCharge()
{
if (!function_exists('sanitize_text_field')) {
function sanitize_text_field() {
return 'Sanitized text';
}
}

$_POST['source'] = ['bank' => 'SCB'];
$obj = new Omise_Payment_FPX();
$this->getChargeTest($obj);
Expand Down

0 comments on commit 72c52d4

Please sign in to comment.