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
12 changes: 6 additions & 6 deletions features/plugin-activate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ Feature: Activate WordPress plugins
And the return code should be 1

Scenario: Activate all when one plugin is hidden by "all_plugins" filter
Given I run `wp plugin install query-monitor`
And a wp-content/mu-plugins/hide-qm-plugin.php file:
Given I run `wp plugin install user-switching`
And a wp-content/mu-plugins/hide-us-plugin.php file:
"""
<?php
/**
* Plugin Name: Hide Query Monitor on Production
* Description: Hides the Query Monitor plugin on production sites
* Plugin Name: Hide User Switching on Production
* Description: Hides the User Switching plugin on production sites
* Author: WP-CLI tests
*/

add_filter( 'all_plugins', function( $all_plugins ) {
unset( $all_plugins['query-monitor/query-monitor.php'] );
unset( $all_plugins['user-switching/user-switching.php'] );
return $all_plugins;
} );
"""
Expand All @@ -59,7 +59,7 @@ Feature: Activate WordPress plugins
"""
And STDOUT should not contain:
"""
Plugin 'query-monitor' activated.
Plugin 'user-switching' activated.
"""

Scenario: Not giving a slug on activate should throw an error unless --all given
Expand Down
1 change: 1 addition & 0 deletions features/plugin-update.feature
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ Feature: Update WordPress plugins
@require-wp-5.2
Scenario: Updating all plugins with some of them having an invalid version shouldn't report an error
Given a WP install
And I run `wp plugin delete akismet`

When I run `wp plugin install health-check --version=1.5.0`
Then STDOUT should not be empty
Expand Down
12 changes: 6 additions & 6 deletions features/plugin.feature
Original file line number Diff line number Diff line change
Expand Up @@ -572,27 +572,27 @@ Feature: Manage WordPress plugins
"""
akismet
jetpack
query-monitor
user-switching
"""
And a wp-content/mu-plugins/hide-qm-plugin.php file:
And a wp-content/mu-plugins/hide-us-plugin.php file:
"""
<?php
/**
* Plugin Name: Hide Query Monitor on Production
* Description: Hides the Query Monitor plugin on production sites
* Plugin Name: Hide User Switchign on Production
* Description: Hides the User Switching plugin on production sites
* Author: WP-CLI tests
*/

add_filter( 'all_plugins', function( $all_plugins ) {
unset( $all_plugins['query-monitor/query-monitor.php'] );
unset( $all_plugins['user-switching/user-switching.php'] );
return $all_plugins;
} );
"""

When I run `wp plugin list --fields=name`
Then STDOUT should not contain:
"""
query-monitor
user-switching
"""

Scenario: Show dropins plugin list
Expand Down