diff --git a/features/plugin.feature b/features/plugin.feature index a0401d65..2a83b87e 100644 --- a/features/plugin.feature +++ b/features/plugin.feature @@ -318,6 +318,27 @@ Feature: Manage WordPress plugins Automattic """ + When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;'` + And save STDOUT as {LAST_UPDATED} + + When I run `wp plugin list --skip-update-check` + Then STDOUT should not be empty + + When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;'` + Then STDOUT should be: + """ + {LAST_UPDATED} + """ + + When I run `wp plugin list` + Then STDOUT should not be empty + + When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;'` + Then STDOUT should not contain: + """ + {LAST_UPDATED} + """ + Scenario: List plugin by multiple statuses Given a WP multisite install And a wp-content/plugins/network-only.php file: diff --git a/features/theme.feature b/features/theme.feature index a42717fc..cccd558d 100644 --- a/features/theme.feature +++ b/features/theme.feature @@ -233,6 +233,34 @@ Feature: Manage WordPress themes | name | status | update | | astra | inactive | none | + + Scenario: Doing wp theme list does a force check by default, deleting any existing transient values + Given a WP install + + When I run `wp theme list` + Then STDOUT should not be empty + + When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;'` + And save STDOUT as {LAST_UPDATED} + + When I run `wp theme list --skip-update-check` + Then STDOUT should not be empty + + When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;'` + Then STDOUT should be: + """ + {LAST_UPDATED} + """ + + When I run `wp theme list` + Then STDOUT should not be empty + + When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;'` + Then STDOUT should not contain: + """ + {LAST_UPDATED} + """ + Scenario: Install a theme when the theme directory doesn't yet exist Given a WP install And I run `wp theme delete --all --force` diff --git a/src/WP_CLI/CommandWithUpgrade.php b/src/WP_CLI/CommandWithUpgrade.php index a1953eab..1d383f58 100755 --- a/src/WP_CLI/CommandWithUpgrade.php +++ b/src/WP_CLI/CommandWithUpgrade.php @@ -543,6 +543,7 @@ protected function _list( $_, $assoc_args ) { // Force WordPress to check for updates if `--skip-update-check` is not passed. if ( false === (bool) Utils\get_flag_value( $assoc_args, 'skip-update-check', false ) ) { + delete_site_transient( $this->upgrade_transient ); call_user_func( $this->upgrade_refresh ); }