From 28e735118032b5ae000c591ad92c84b53b634d50 Mon Sep 17 00:00:00 2001 From: Leif Singer Date: Tue, 12 Mar 2024 13:22:38 +0100 Subject: [PATCH] Fix the `test_widget_renders_completed_task_count` unit test (#45509) --- .../changelog/fix-test-widget-renders-completed-task-count | 4 ++++ .../includes/admin/class-wc-admin-dashboard-setup-test.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 plugins/woocommerce/changelog/fix-test-widget-renders-completed-task-count diff --git a/plugins/woocommerce/changelog/fix-test-widget-renders-completed-task-count b/plugins/woocommerce/changelog/fix-test-widget-renders-completed-task-count new file mode 100644 index 00000000000..ed61eb0c200 --- /dev/null +++ b/plugins/woocommerce/changelog/fix-test-widget-renders-completed-task-count @@ -0,0 +1,4 @@ +Significance: patch +Type: dev + +Fix a failing unit test. diff --git a/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php b/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php index 51b31b7b903..4cd788e4b22 100644 --- a/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php +++ b/plugins/woocommerce/tests/php/includes/admin/class-wc-admin-dashboard-setup-test.php @@ -191,7 +191,7 @@ class WC_Admin_Dashboard_Setup_Test extends WC_Unit_Test_Case { if ( $completed_tasks_count === $tasks_count ) { $this->assertEmpty( $this->get_widget_output() ); } else { - $this->assertMatchesRegularExpression( "/Step {$step_number} of 5/", $this->get_widget_output() ); + $this->assertMatchesRegularExpression( "/Step {$step_number} of {$tasks_count}/", $this->get_widget_output() ); } } }