diff --git a/composer.json b/composer.json index 2e959323..ea41953c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "wp-cli/entity-command": "^1.3 || ^2 || ^3", "wp-cli/language-command": "^2.0 || ^3", "wp-cli/scaffold-command": "^1.2 || ^2 || ^3", - "wp-cli/wp-cli-tests": "^5" + "wp-cli/wp-cli-tests": "dev-only-these-themes as 5.3.99" }, "config": { "process-timeout": 7200, diff --git a/features/theme-auto-update-status.feature b/features/theme-auto-update-status.feature index 8c5f78ed..3b2f95da 100644 --- a/features/theme-auto-update-status.feature +++ b/features/theme-auto-update-status.feature @@ -2,10 +2,12 @@ Feature: Show the status of auto-updates for WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And I run `wp theme install twentysixteen` - And I run `wp theme install twentyseventeen` - And I run `wp theme install twentynineteen` + And only these installed themes: + """ + twentysixteen + twentyseventeen + twentynineteen + """ @require-wp-5.5 Scenario: Show an error if required params are missing diff --git a/features/theme-auto-updates-disable.feature b/features/theme-auto-updates-disable.feature index 54a09b03..41656521 100644 --- a/features/theme-auto-updates-disable.feature +++ b/features/theme-auto-updates-disable.feature @@ -2,10 +2,12 @@ Feature: Disable auto-updates for WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And I run `wp theme install twentysixteen` - And I run `wp theme install twentyseventeen` - And I run `wp theme install twentynineteen` + And only these installed themes: + """ + twentysixteen + twentyseventeen + twentynineteen + """ And I try `wp theme auto-updates enable --all` @require-wp-5.5 diff --git a/features/theme-auto-updates-enable.feature b/features/theme-auto-updates-enable.feature index c317a039..7edd2d3c 100644 --- a/features/theme-auto-updates-enable.feature +++ b/features/theme-auto-updates-enable.feature @@ -2,10 +2,12 @@ Feature: Enable auto-updates for WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And I run `wp theme install twentysixteen` - And I run `wp theme install twentyseventeen` - And I run `wp theme install twentynineteen` + And only these installed themes: + """ + twentysixteen + twentyseventeen + twentynineteen + """ And I try `wp theme auto-updates disable --all` @require-wp-5.5 diff --git a/features/theme-delete.feature b/features/theme-delete.feature index 1d9fa979..ad33c575 100644 --- a/features/theme-delete.feature +++ b/features/theme-delete.feature @@ -2,9 +2,14 @@ Feature: Delete WordPress themes Background: Given a WP install - And I run `wp theme delete --all --force` - And I run `wp theme install twentytwelve` - And I run `wp theme install twentyeleven --activate` + And only these installed themes: + """ + twentytwelve + """ + And these installed and active themes: + """ + twentyeleven + """ Scenario: Delete an installed theme When I run `wp theme delete 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 20038036..69d26961 100644 --- a/features/theme-update.feature +++ b/features/theme-update.feature @@ -16,7 +16,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 @@ -239,7 +239,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 a01e2135..e487e7fa 100644 --- a/features/theme.feature +++ b/features/theme.feature @@ -12,8 +12,10 @@ Feature: Manage WordPress themes Scenario: Installing and deleting theme Given a WP install - And I run `wp theme delete --all --force` - And I run `wp theme install twentyeleven --activate` + And only these installed and active themes: + """ + twentyeleven + """ When I run `wp theme install twentytwelve` Then STDOUT should not be empty @@ -85,8 +87,10 @@ 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 I run `wp theme install twentyeleven --activate` + And only these installed and active themes: + """ + twentyeleven + """ When I run `wp theme install twentytwelve --version=1.4` Then STDOUT should not be empty @@ -142,8 +146,10 @@ Feature: Manage WordPress themes Scenario: Exclude theme from bulk updates. Given a WP install - And I run `wp theme delete --all --force` - And I run `wp theme install twentyeleven --activate` + And only these installed and active themes: + """ + twentyeleven + """ When I run `wp theme install twentytwelve --version=1.4 --force` Then STDOUT should contain: @@ -185,7 +191,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 @@ -198,7 +204,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 @@ -276,7 +282,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';"` @@ -487,7 +493,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 @@ -527,7 +533,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 @@ -581,7 +587,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 @@ -608,7 +614,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 @@ -667,9 +673,14 @@ 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 I run `wp theme install twentytwelve` - And I run `wp theme install oceanly-green --activate` + And only these installed themes: + """ + twentytwelve + """ + And these installed and active themes: + """ + oceanly-green + """ When I run `wp theme is-active oceanly-green` Then the return code should be 0 @@ -682,8 +693,10 @@ 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 I run `wp theme install twentytwelve --version=1.5 --activate` + And only these installed and active themes: + """ + twentytwelve --version=1.5 + """ And I run `wp theme update --all --exclude=missing-theme` Then STDERR should be empty And STDOUT should contain: @@ -882,9 +895,14 @@ Feature: Manage WordPress themes Scenario: Filter theme list by multiple names Given a WP install - And I run `wp theme delete --all --force` - And I run `wp theme install twentyeleven --activate` - And I run `wp theme install twentytwelve` + And only these installed themes: + """ + twentytwelve + """ + And these installed and active themes: + """ + twentyeleven + """ When I run `wp theme list --name=twentytwelve,twentyeleven --fields=name,status` Then STDOUT should be a table containing rows: