File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,27 @@ Feature: Manage WordPress plugins
318318 Automattic
319319 """
320320
321+ When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;' `
322+ And save STDOUT as {LAST_UPDATED}
323+
324+ When I run `wp plugin list --skip-update-check`
325+ Then STDOUT should not be empty
326+
327+ When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;' `
328+ Then STDOUT should be:
329+ """
330+ {LAST_UPDATED}
331+ """
332+
333+ When I run `wp plugin list`
334+ Then STDOUT should not be empty
335+
336+ When I run `wp eval 'echo get_site_transient("update_plugins")->last_checked;' `
337+ Then STDOUT should not contain:
338+ """
339+ {LAST_UPDATED}
340+ """
341+
321342 Scenario : List plugin by multiple statuses
322343 Given a WP multisite install
323344 And a wp-content/plugins/network-only.php file:
Original file line number Diff line number Diff line change @@ -233,6 +233,34 @@ Feature: Manage WordPress themes
233233 | name | status | update |
234234 | astra | inactive | none |
235235
236+
237+ Scenario : Doing wp theme list does a force check by default, deleting any existing transient values
238+ Given a WP install
239+
240+ When I run `wp theme list`
241+ Then STDOUT should not be empty
242+
243+ When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;' `
244+ And save STDOUT as {LAST_UPDATED}
245+
246+ When I run `wp theme list --skip-update-check`
247+ Then STDOUT should not be empty
248+
249+ When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;' `
250+ Then STDOUT should be:
251+ """
252+ {LAST_UPDATED}
253+ """
254+
255+ When I run `wp theme list`
256+ Then STDOUT should not be empty
257+
258+ When I run `wp eval 'echo get_site_transient("update_themes")->last_checked;' `
259+ Then STDOUT should not contain:
260+ """
261+ {LAST_UPDATED}
262+ """
263+
236264 Scenario : Install a theme when the theme directory doesn't yet exist
237265 Given a WP install
238266 And I run `wp theme delete --all --force`
Original file line number Diff line number Diff line change @@ -543,6 +543,7 @@ protected function _list( $_, $assoc_args ) {
543543
544544 // Force WordPress to check for updates if `--skip-update-check` is not passed.
545545 if ( false === (bool ) Utils \get_flag_value ( $ assoc_args , 'skip-update-check ' , false ) ) {
546+ delete_site_transient ( $ this ->upgrade_transient );
546547 call_user_func ( $ this ->upgrade_refresh );
547548 }
548549
You can’t perform that action at this time.
0 commit comments