From f42ee9ed68b63370ae93837b2f8b0a9653f98c5f Mon Sep 17 00:00:00 2001 From: Aashish Date: Mon, 27 May 2024 13:32:27 +0700 Subject: [PATCH] Fix test --- includes/gateway/class-omise-payment-truemoney.php | 2 +- .../includes/gateway/class-omise-payment-truemoney-test.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/gateway/class-omise-payment-truemoney.php b/includes/gateway/class-omise-payment-truemoney.php index e4d3a71d..f80b5bf4 100644 --- a/includes/gateway/class-omise-payment-truemoney.php +++ b/includes/gateway/class-omise-payment-truemoney.php @@ -33,6 +33,7 @@ public function __construct() $this->title = $this->get_option( 'title' ); $this->description = $this->get_option( 'description' ); $this->restricted_countries = array( 'TH' ); + $this->source_type = null; add_action( 'woocommerce_update_options_payment_gateways_' . $this->id, array( $this, 'process_admin_options' ) ); add_action( 'woocommerce_api_' . $this->id . '_callback', 'Omise_Callback::execute' ); @@ -85,7 +86,6 @@ public function is_wallet() // the Capability API is not being called from WC blocks. if (!$this->source_type) { $this->source_type = $this->get_source(); - } return self::WALLET === $this->source_type; diff --git a/tests/unit/includes/gateway/class-omise-payment-truemoney-test.php b/tests/unit/includes/gateway/class-omise-payment-truemoney-test.php index cde106de..258567f5 100644 --- a/tests/unit/includes/gateway/class-omise-payment-truemoney-test.php +++ b/tests/unit/includes/gateway/class-omise-payment-truemoney-test.php @@ -25,7 +25,6 @@ public function setUp(): void public function test_get_charge_request() { - $this->omise_capability_mock->shouldReceive('retrieve')->once(); // set source type to truemoney wallet $obj = new Omise_Payment_Truemoney(); $obj->source_type = 'truemoney';