diff --git a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php index e3d1afd..4f1e440 100644 --- a/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php +++ b/src/include/abstracts/class-wc-retailcrm-abstracts-settings.php @@ -281,20 +281,9 @@ abstract class WC_Retailcrm_Abstracts_Settings extends WC_Integration } foreach ($wc_payment->get_available_payment_gateways() as $payment) { - $title = ''; - $description = ''; - - if (empty($payment->method_title)) { - $title = $payment->id; - } else { - $title = $payment->method_title; - } - - if (empty($payment->method_description)) { - $description = $payment->description; - } else { - $description = $payment->method_description; - } + $title = empty($payment->method_title) ? $payment->id : $payment->method_title; + $description = empty($payment->method_description) ? $payment->description : + $payment->method_description; $this->form_fields[$payment->id] = [ 'css' => 'min-width:350px;', diff --git a/tests/abstracts/test-wc-retailcrm-abstract-builder.php b/tests/abstracts/test-wc-retailcrm-abstract-builder.php index 3671846..4853b54 100644 --- a/tests/abstracts/test-wc-retailcrm-abstract-builder.php +++ b/tests/abstracts/test-wc-retailcrm-abstract-builder.php @@ -47,6 +47,7 @@ class WC_Retailcrm_Abstracts_Settings_Test extends WC_Retailcrm_Test_Case_Helpe public function test_validate_payments() { + $this->register_lagacy_proxy_static_mocks; $paymentGateway = new WC_Payment_Gateways(); $enabledPayments = $paymentGateway->get_available_payment_gateways();