From 80de5a1329c445404da62fc4374b38bacc624b70 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 2 Nov 2026 04:45:32 +0100 Subject: [PATCH] Use `only these installed themes` in tests Co-Authored-By: Claude Opus 5.5 --- features/theme-auto-update-status.feature | 3 +- features/theme-auto-updates-disable.feature | 3 +- features/theme-auto-updates-enable.feature | 3 +- features/theme-delete.feature | 3 +- features/theme-install.feature | 2 +- features/theme-update.feature | 4 +-- features/theme.feature | 38 +++++++++------------ 7 files changed, 23 insertions(+), 33 deletions(-) diff --git a/features/theme-auto-update-status.feature b/features/theme-auto-update-status.feature index 4fbbf7b3..3b2f95da 100644 --- a/features/theme-auto-update-status.feature +++ b/features/theme-auto-update-status.feature @@ -2,8 +2,7 @@ Feature: Show the status of auto-updates for WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And these installed themes: + And only these installed themes: """ twentysixteen twentyseventeen diff --git a/features/theme-auto-updates-disable.feature b/features/theme-auto-updates-disable.feature index 00100080..41656521 100644 --- a/features/theme-auto-updates-disable.feature +++ b/features/theme-auto-updates-disable.feature @@ -2,8 +2,7 @@ Feature: Disable auto-updates for WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And these installed themes: + And only these installed themes: """ twentysixteen twentyseventeen diff --git a/features/theme-auto-updates-enable.feature b/features/theme-auto-updates-enable.feature index 51817903..7edd2d3c 100644 --- a/features/theme-auto-updates-enable.feature +++ b/features/theme-auto-updates-enable.feature @@ -2,8 +2,7 @@ Feature: Enable auto-updates for WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And these installed themes: + And only these installed themes: """ twentysixteen twentyseventeen diff --git a/features/theme-delete.feature b/features/theme-delete.feature index bbf7b645..1a3df829 100644 --- a/features/theme-delete.feature +++ b/features/theme-delete.feature @@ -2,8 +2,7 @@ Feature: Delete WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And these installed themes: + And only these installed themes: """ twentytwelve """ diff --git a/features/theme-install.feature b/features/theme-install.feature index c62d3bd2..b4bd2652 100644 --- a/features/theme-install.feature +++ b/features/theme-install.feature @@ -2,7 +2,7 @@ Feature: Install WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory Scenario: Return code is 1 when one or more theme installations fail When I try `wp theme install twentytwelve twentytwelve-not-a-theme` diff --git a/features/theme-update.feature b/features/theme-update.feature index 3cd89a69..c96e38d4 100644 --- a/features/theme-update.feature +++ b/features/theme-update.feature @@ -19,7 +19,7 @@ Feature: Update WordPress themes Scenario: Install a theme, then update to a specific version of that theme Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install twentytwelve --version=3.0` Then STDOUT should not be empty @@ -254,7 +254,7 @@ Feature: Update WordPress themes @require-wp-4.5 Scenario: Updating all themes should show the name of each theme as it is updated Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install storefront --version=1.0.0` Then STDOUT should not be empty diff --git a/features/theme.feature b/features/theme.feature index be12e0fd..ff1c35ac 100644 --- a/features/theme.feature +++ b/features/theme.feature @@ -12,8 +12,7 @@ Feature: Manage WordPress themes Scenario: Installing and deleting theme Given a WP install - And I run `wp theme delete --all --force` - And these installed and active themes: + And only these installed and active themes: """ twentyeleven """ @@ -91,8 +90,7 @@ Feature: Manage WordPress themes Scenario: Install a theme, activate, then force install an older version of the theme Given a WP install - And I run `wp theme delete --all --force` - And these installed and active themes: + And only these installed and active themes: """ twentyeleven """ @@ -151,8 +149,7 @@ Feature: Manage WordPress themes Scenario: Exclude theme from bulk updates. Given a WP install - And I run `wp theme delete --all --force` - And these installed and active themes: + And only these installed and active themes: """ twentyeleven """ @@ -197,7 +194,7 @@ Feature: Manage WordPress themes Scenario: Get the path of an installed theme Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install twentytwelve` Then STDOUT should not be empty @@ -210,7 +207,7 @@ Feature: Manage WordPress themes Scenario: Activate an already active theme Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install twentytwelve` Then STDOUT should not be empty @@ -288,7 +285,7 @@ Feature: Manage WordPress themes Scenario: Install a theme when the theme directory doesn't yet exist Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `rm -rf wp-content/themes` And I run `wp eval "if ( is_dir('wp-content/themes') ) echo 'fail';"` @@ -514,7 +511,7 @@ Feature: Manage WordPress themes Scenario: When updating a theme --format should be the same when using --dry-run Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install --force twentytwelve --version=1.0` Then STDOUT should not be empty @@ -554,7 +551,7 @@ Feature: Manage WordPress themes Scenario: Check json and csv formats when updating a theme Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install --force twentytwelve --version=1.0` Then STDOUT should not be empty @@ -608,7 +605,7 @@ Feature: Manage WordPress themes Scenario: Get status field in theme detail Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install twentytwelve` Then STDOUT should not be empty @@ -635,7 +632,7 @@ Feature: Manage WordPress themes Scenario: Theme activation fails when slug does not match exactly Given a WP install - And I run `wp theme delete --all --force` + And an empty wp-content/themes directory When I run `wp theme install twentytwelve` Then the return code should be 0 @@ -694,8 +691,7 @@ Feature: Manage WordPress themes @require-wp-5.7 Scenario: Parent theme is active when its child is active Given a WP install - And I run `wp theme delete --all --force` - And these installed themes: + And only these installed themes: """ twentytwelve """ @@ -715,8 +711,7 @@ Feature: Manage WordPress themes Scenario: Excluding a missing theme should not throw an error Given a WP install - And I run `wp theme delete --all --force` - And these installed and active themes: + And only these installed and active themes: """ twentytwelve --version=1.5 """ @@ -921,14 +916,13 @@ Feature: Manage WordPress themes Scenario: Filter theme list by multiple names Given a WP install - And I run `wp theme delete --all --force` - And these installed and active themes: + And only these installed themes: """ - twentyeleven + twentytwelve """ - And these installed themes: + And these installed and active themes: """ - twentytwelve + twentyeleven """ When I run `wp theme list --name=twentytwelve,twentyeleven --fields=name,status`