From 507a6dcfed6708b6af1a369689e1ca83b4ec9c22 Mon Sep 17 00:00:00 2001 From: Mike Crantea Date: Wed, 26 Jun 2024 12:19:15 +0100 Subject: [PATCH] Fix tests (to reference the right ID for tracking ratio) --- tests/phpunit/class-test-settings.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/class-test-settings.php b/tests/phpunit/class-test-settings.php index 979e447..545e4be 100644 --- a/tests/phpunit/class-test-settings.php +++ b/tests/phpunit/class-test-settings.php @@ -129,7 +129,7 @@ public function test_settings_init__field_web_vitals_tracking_ratio() { $this->assertSame( $field_name, $field['id'] ); $this->assertSame( 'Web Vitals Tracking Ratio', $field['title'] ); - $this->assertSame( array( $this->settings->fields[5], 'render' ), $field['callback'] ); + $this->assertSame( array( $this->settings->fields[2], 'render' ), $field['callback'] ); $this->assertSame( array( @@ -250,7 +250,7 @@ public function test_web_vitals_tracking_ratio_render__empty_options() { $this->settings->settings_init(); ob_start(); - $this->settings->fields[5]->render(); + $this->settings->fields[2]->render(); $result = ob_get_contents(); ob_end_clean(); @@ -270,7 +270,7 @@ public function test_web_vitals_tracking_ratio_render__set_web_vitals_tracking_r add_option( 'spt_settings', array( 'web_vitals_tracking_ratio' => 0.05 ) ); ob_start(); - $this->settings->fields[5]->render(); + $this->settings->fields[2]->render(); $result = ob_get_contents(); ob_end_clean(); @@ -291,7 +291,7 @@ public function test_web_vitals_tracking_ratio_render__theme_web_vitals_tracking $this->settings->settings_init(); ob_start(); - $this->settings->fields[5]->render(); + $this->settings->fields[2]->render(); $result = ob_get_contents(); ob_end_clean(); @@ -318,7 +318,7 @@ function () { ); ob_start(); - $this->settings->fields[5]->render(); + $this->settings->fields[2]->render(); $result = ob_get_contents(); ob_end_clean();