From 575d90ee207c4e08400fae8a598355ec69198122 Mon Sep 17 00:00:00 2001 From: Eason Date: Tue, 4 Jul 2023 11:38:35 +0800 Subject: [PATCH] Simplify `test_get_country_code_sanitize_callback_with_string` test case code to a single line. Ref: https://github.com/woocommerce/google-listings-and-ads/pull/2004#discussion_r1250915645 Co-authored-by: martynmjones <40762232+martynmjones@users.noreply.github.com> --- tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php b/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php index e39d35bbf2..7675c91efc 100644 --- a/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php +++ b/tests/Unit/API/Site/Controllers/CountryCodeTraitTest.php @@ -127,10 +127,7 @@ public function test_all_get_validate_callbacks_with_rest_validate_request_arg() * Test a sanitized country code with a string. */ public function test_get_country_code_sanitize_callback_with_string() { - $callback = $this->trait->get_country_code_sanitize_callback(); - $result = $callback( 'us' ); - - $this->assertEquals( 'US', $result ); + $this->assertEquals( 'US', $this->trait->get_country_code_sanitize_callback()( 'us' ) ); } /**