From a0701f6ea5f616b031429370b1546ed3c45206c2 Mon Sep 17 00:00:00 2001 From: RJ <27843274+rjchow@users.noreply.github.com> Date: Wed, 24 Apr 2024 18:51:49 +1200 Subject: [PATCH] fix: removed live explat test (#46818) --- .../changelog/fix-remove-live-explat-test | 5 +++++ .../includes/class-experimental-abtest-test.php | 13 ++----------- 2 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 plugins/woocommerce/changelog/fix-remove-live-explat-test diff --git a/plugins/woocommerce/changelog/fix-remove-live-explat-test b/plugins/woocommerce/changelog/fix-remove-live-explat-test new file mode 100644 index 00000000000..e454d8f7ee1 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-remove-live-explat-test @@ -0,0 +1,5 @@ +Significance: patch +Type: fix + +Removed explat test that calls live explat server + diff --git a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/includes/class-experimental-abtest-test.php b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/includes/class-experimental-abtest-test.php index 870e63f8602..e50ee1d5be1 100644 --- a/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/includes/class-experimental-abtest-test.php +++ b/plugins/woocommerce/tests/legacy/unit-tests/woocommerce-admin/includes/class-experimental-abtest-test.php @@ -51,7 +51,7 @@ class Experimental_Abtest_Test extends WC_Unit_Test_Case { } /** - * Tests retrieve the test variation when consent is false + * Tests retrieve the default control variation when consent is false */ public function test_get_variation_return_control_when_no_consent() { $exp = new Experimental_Abtest( 'anon', 'platform', false ); @@ -62,7 +62,7 @@ class Experimental_Abtest_Test extends WC_Unit_Test_Case { } /** - * Tests retrieve the test variation when consent is false + * Tests retrieve the treatment variation when consent is true and experiment name is valid */ public function test_get_variation() { delete_transient( 'abtest_variation_control' ); @@ -104,15 +104,6 @@ class Experimental_Abtest_Test extends WC_Unit_Test_Case { ); } - /** - * Test get_variation with valid experiment name. - */ - public function test_fetch_variation_with_valid_name() { - $exp = new Experimental_Abtest( 'anon', 'platform', true ); - $variation = $exp->get_variation( 'valid_experiment_name_2' ); - $this->assertNotInstanceOf( 'WP_Error', $variation ); - } - /** * Test get_variation with invalid experiment name. */