From fb0c33815652b6a4d2ea21c3fb97e216581a3517 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Sat, 28 Mar 2026 12:56:21 +0100 Subject: [PATCH] Tests: improve Windows compatibility --- features/sidebar.feature | 7 ++++++- features/widget-reset.feature | 13 ++++++++++++- features/widget.feature | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/features/sidebar.feature b/features/sidebar.feature index cf56f6a1..b2f4533b 100644 --- a/features/sidebar.feature +++ b/features/sidebar.feature @@ -30,7 +30,12 @@ Feature: Manage WordPress sidebars 0 """ - When I run `wp eval 'update_option( "sidebars_widgets", array_merge( wp_get_sidebars_widgets(), [ "orphaned-sidebar-1" => [] ] ) );'` + Given a sidebar-update.php file: + """ + [] ] ) ); + """ + When I run `wp eval-file sidebar-update.php` And I run `wp sidebar list --inactive --fields=id --format=csv` Then STDOUT should be: """ diff --git a/features/widget-reset.feature b/features/widget-reset.feature index 6f923dc1..38c18317 100644 --- a/features/widget-reset.feature +++ b/features/widget-reset.feature @@ -129,6 +129,7 @@ Feature: Reset WordPress sidebars text-1 """ + @skip-windows Scenario: Testing movement of widgets while reset When I run `wp widget add calendar sidebar-2 --title="Calendar"` Then STDOUT should not be empty @@ -141,6 +142,8 @@ Feature: Reset WordPress sidebars """ calendar-1 search-1 """ + + # TODO: Investigate why output is not empty on Windows When I run `wp widget list wp_inactive_widgets --format=ids` Then STDOUT should be empty @@ -166,7 +169,15 @@ Feature: Reset WordPress sidebars Then STDOUT should not be empty # Simulate an inactive (unregistered) sidebar by moving widget data to an orphaned key - When I run `wp eval '$w = wp_get_sidebars_widgets(); $w["orphaned-sidebar-1"] = $w["sidebar-1"]; $w["sidebar-1"] = []; update_option( "sidebars_widgets", $w );'` + Given a widget-orphaned-reset.php file: + """ +