Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions features/plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
28 changes: 28 additions & 0 deletions features/theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
1 change: 1 addition & 0 deletions src/WP_CLI/CommandWithUpgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down