From 0197831ad5b231552e7e2c2cf16953f0fd12c284 Mon Sep 17 00:00:00 2001 From: Dan0sz <18595395+Dan0sz@users.noreply.github.com> Date: Fri, 7 Jun 2024 12:31:13 +0200 Subject: [PATCH] Ignore AddJS --- src/Integrations/WooCommerce.php | 2 ++ .../integration/Integrations/WooCommerceTest.php | 15 --------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/Integrations/WooCommerce.php b/src/Integrations/WooCommerce.php index 309a1bd0..4146d3fd 100644 --- a/src/Integrations/WooCommerce.php +++ b/src/Integrations/WooCommerce.php @@ -89,6 +89,8 @@ private function init( $init ) { * Enqueue required JS in frontend. * * @return void + * + * @codeCoverageIgnore Because there's nothing to test here. */ public function add_js() { // Causes errors in checkout and isn't needed either way. diff --git a/tests/integration/Integrations/WooCommerceTest.php b/tests/integration/Integrations/WooCommerceTest.php index ca72b456..5666ec70 100644 --- a/tests/integration/Integrations/WooCommerceTest.php +++ b/tests/integration/Integrations/WooCommerceTest.php @@ -10,21 +10,6 @@ use function Brain\Monkey\Functions\when; class WooCommerceTest extends TestCase { - /** - * @see WooCommerce::add_js() - */ - public function testAddJs() { - when( 'is_checkout' )->justReturn( false ); - - $class = new WooCommerce( false ); - - $class->add_js(); - - $wp_scripts = wp_scripts(); - - $this->assertTrue( in_array( 'plausible-woocommerce-compatibility', $wp_scripts->queue ) ); - } - /** * @see WooCommerce::track_entered_checkout() * @return void