diff --git a/features/plugin-auto-updates-disable.feature b/features/plugin-auto-updates-disable.feature index fb932ca3..e749e452 100644 --- a/features/plugin-auto-updates-disable.feature +++ b/features/plugin-auto-updates-disable.feature @@ -32,7 +32,7 @@ Feature: Disable auto-updates for WordPress plugins """ And the return code should be 0 - @require-wp-5.5 + @require-wp-5.5 @require-mysql Scenario: Disable auto-updates for all plugins When I run `wp plugin auto-updates disable --all` Then STDOUT should be: @@ -41,7 +41,16 @@ Feature: Disable auto-updates for WordPress plugins """ And the return code should be 0 - @require-wp-5.5 + @require-wp-5.5 @require-sqlite + Scenario: Disable auto-updates for all plugins + When I run `wp plugin auto-updates disable --all` + Then STDOUT should be: + """ + Success: Disabled 4 of 4 plugin auto-updates. + """ + And the return code should be 0 + + @require-wp-5.5 @require-mysql Scenario: Disable auto-updates for already disabled plugins When I run `wp plugin auto-updates disable hello` And I try `wp plugin auto-updates disable --all` @@ -54,7 +63,20 @@ Feature: Disable auto-updates for WordPress plugins Error: Only disabled 2 of 3 plugin auto-updates. """ - @require-wp-5.5 + @require-wp-5.5 @require-sqlite + Scenario: Disable auto-updates for already disabled plugins + When I run `wp plugin auto-updates disable hello` + And I try `wp plugin auto-updates disable --all` + Then STDERR should contain: + """ + Warning: Auto-updates already disabled for plugin hello. + """ + And STDERR should contain: + """ + Error: Only disabled 3 of 4 plugin auto-updates. + """ + + @require-wp-5.5 @require-mysql Scenario: Filter when enabling auto-updates for already disabled plugins When I run `wp plugin auto-updates disable hello` And I run `wp plugin auto-updates disable --all --enabled-only` @@ -64,6 +86,16 @@ Feature: Disable auto-updates for WordPress plugins """ And the return code should be 0 + @require-wp-5.5 @require-sqlite + Scenario: Filter when enabling auto-updates for already disabled plugins + When I run `wp plugin auto-updates disable hello` + And I run `wp plugin auto-updates disable --all --enabled-only` + Then STDOUT should be: + """ + Success: Disabled 3 of 3 plugin auto-updates. + """ + And the return code should be 0 + @require-wp-5.5 Scenario: Filter when enabling auto-updates for already disabled selection of plugins When I run `wp plugin auto-updates disable hello` diff --git a/features/plugin-auto-updates-enable.feature b/features/plugin-auto-updates-enable.feature index 5718867a..8b4205f8 100644 --- a/features/plugin-auto-updates-enable.feature +++ b/features/plugin-auto-updates-enable.feature @@ -31,7 +31,7 @@ Feature: Enable auto-updates for WordPress plugins """ And the return code should be 0 - @require-wp-5.5 + @require-wp-5.5 @require-mysql Scenario: Enable auto-updates for all plugins When I run `wp plugin auto-updates enable --all` Then STDOUT should be: @@ -40,7 +40,16 @@ Feature: Enable auto-updates for WordPress plugins """ And the return code should be 0 - @require-wp-5.5 + @require-wp-5.5 @require-sqlite + Scenario: Enable auto-updates for all plugins + When I run `wp plugin auto-updates enable --all` + Then STDOUT should be: + """ + Success: Enabled 4 of 4 plugin auto-updates. + """ + And the return code should be 0 + + @require-wp-5.5 @require-mysql Scenario: Enable auto-updates for already enabled plugins When I run `wp plugin auto-updates enable hello` And I try `wp plugin auto-updates enable --all` @@ -53,7 +62,20 @@ Feature: Enable auto-updates for WordPress plugins Error: Only enabled 2 of 3 plugin auto-updates. """ - @require-wp-5.5 + @require-wp-5.5 @require-sqlite + Scenario: Enable auto-updates for already enabled plugins + When I run `wp plugin auto-updates enable hello` + And I try `wp plugin auto-updates enable --all` + Then STDERR should contain: + """ + Warning: Auto-updates already enabled for plugin hello. + """ + And STDERR should contain: + """ + Error: Only enabled 3 of 4 plugin auto-updates. + """ + + @require-wp-5.5 @require-mysql Scenario: Filter when enabling auto-updates for already enabled plugins When I run `wp plugin auto-updates enable hello` And I run `wp plugin auto-updates enable --all --disabled-only` @@ -63,6 +85,16 @@ Feature: Enable auto-updates for WordPress plugins """ And the return code should be 0 + @require-wp-5.5 @require-sqlite + Scenario: Filter when enabling auto-updates for already enabled plugins + When I run `wp plugin auto-updates enable hello` + And I run `wp plugin auto-updates enable --all --disabled-only` + Then STDOUT should be: + """ + Success: Enabled 3 of 3 plugin auto-updates. + """ + And the return code should be 0 + @require-wp-5.5 Scenario: Filter when enabling auto-updates for already enabled selection of plugins When I run `wp plugin auto-updates enable hello` diff --git a/features/plugin-auto-updates-status.feature b/features/plugin-auto-updates-status.feature index 939ff719..39ef039a 100644 --- a/features/plugin-auto-updates-status.feature +++ b/features/plugin-auto-updates-status.feature @@ -81,7 +81,7 @@ Feature: Show the status of auto-updates for WordPress plugins Error: --enabled-only and --disabled-only are mutually exclusive and cannot be used at the same time. """ - @require-wp-5.5 + @require-wp-5.5 @require-mysql Scenario: The fields can be shown individually Given I run `wp plugin auto-updates enable hello` @@ -98,9 +98,26 @@ Feature: Show the status of auto-updates for WordPress plugins enabled """ - @require-wp-5.5 - Scenario: Formatting options work + @require-wp-5.5 @require-sqlite + Scenario: The fields can be shown individually + Given I run `wp plugin auto-updates enable hello` + + When I run `wp plugin auto-updates status --all --disabled-only --field=name` + Then STDOUT should be: + """ + akismet + sqlite-database-integration + duplicate-post + """ + + When I run `wp plugin auto-updates status hello --field=status` + Then STDOUT should be: + """ + enabled + """ + @require-wp-5.5 @require-mysql + Scenario: Formatting options work When I run `wp plugin auto-updates status --all --format=json` Then STDOUT should be: """ @@ -115,3 +132,21 @@ Feature: Show the status of auto-updates for WordPress plugins hello,disabled duplicate-post,disabled """ + + @require-wp-5.5 @require-sqlite + Scenario: Formatting options work + When I run `wp plugin auto-updates status --all --format=json` + Then STDOUT should be: + """ + [{"name":"akismet","status":"disabled"},{"name":"hello","status":"disabled"},{"name":"sqlite-database-integration","status":"disabled"},{"name":"duplicate-post","status":"disabled"}] + """ + + When I run `wp plugin auto-updates status --all --format=csv` + Then STDOUT should be: + """ + name,status + akismet,disabled + hello,disabled + sqlite-database-integration,disabled + duplicate-post,disabled + """ diff --git a/features/plugin-delete.feature b/features/plugin-delete.feature index 8fc3cc9d..af1e1c7d 100644 --- a/features/plugin-delete.feature +++ b/features/plugin-delete.feature @@ -12,6 +12,7 @@ Feature: Delete WordPress plugins """ And the return code should be 0 + @require-mysql Scenario: Delete all installed plugins When I run `wp plugin delete --all` Then STDOUT should be: @@ -28,6 +29,24 @@ Feature: Delete WordPress plugins Success: No plugins deleted. """ + @require-sqlite + Scenario: Delete all installed plugins + When I run `wp plugin delete --all` + Then STDOUT should be: + """ + Deleted 'akismet' plugin. + Deleted 'hello' plugin. + Deleted 'sqlite-database-integration' plugin. + Success: Deleted 3 of 3 plugins. + """ + And the return code should be 0 + + When I run the previous command again + Then STDOUT should be: + """ + Success: No plugins deleted. + """ + Scenario: Attempting to delete a plugin that doesn't exist When I try `wp plugin delete edit-flow` Then STDOUT should be: @@ -40,6 +59,7 @@ Feature: Delete WordPress plugins """ And the return code should be 0 + @require-mysql Scenario: Excluding a plugin from deletion when using --all switch When I try `wp plugin delete --all --exclude=akismet,hello` Then STDOUT should be: @@ -48,6 +68,15 @@ Feature: Delete WordPress plugins """ And the return code should be 0 + @require-sqlite + Scenario: Excluding a plugin from deletion when using --all switch + When I try `wp plugin delete --all --exclude=akismet,hello,sqlite-database-integration` + Then STDOUT should be: + """ + Success: No plugins deleted. + """ + And the return code should be 0 + Scenario: Excluding a missing plugin should not throw an error Given a WP install And I run `wp plugin delete --all --exclude=missing-plugin` diff --git a/features/plugin-uninstall.feature b/features/plugin-uninstall.feature index 998d5a1a..b224fc6d 100644 --- a/features/plugin-uninstall.feature +++ b/features/plugin-uninstall.feature @@ -72,6 +72,7 @@ Feature: Uninstall a WordPress plugin Success: Uninstalled 2 of 2 plugins. """ + @require-mysql Scenario: Excluding a plugin from uninstallation when using --all switch When I try `wp plugin uninstall --all --exclude=akismet,hello` Then STDOUT should be: @@ -80,7 +81,14 @@ Feature: Uninstall a WordPress plugin """ And the return code should be 0 - + @require-sqlite + Scenario: Excluding a plugin from uninstallation when using --all switch + When I try `wp plugin uninstall --all --exclude=akismet,hello,sqlite-database-integration` + Then STDOUT should be: + """ + Success: No plugins uninstalled. + """ + And the return code should be 0 Scenario: Excluding a missing plugin should not throw an error Given a WP install