-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathskip-plugins.feature
More file actions
120 lines (103 loc) · 3.91 KB
/
skip-plugins.feature
File metadata and controls
120 lines (103 loc) · 3.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Feature: Skipping plugins
Scenario: Skipping plugins via global flag
Given a WP installation
And I run `wp plugin install https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
And I run `wp plugin activate akismet sample-plugin`
When I run `wp eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "sample_plugin" ) );'`
Then STDOUT should be:
"""
truetrue
"""
# The specified plugin should be skipped
When I run `wp --skip-plugins=akismet eval 'var_export( defined("AKISMET_VERSION") );'`
Then STDOUT should be:
"""
false
"""
# The specified plugin should still show up as an active plugin
When I run `wp --skip-plugins=akismet plugin status akismet`
Then STDOUT should contain:
"""
Status: Active
"""
# The un-specified plugin should continue to be loaded
When I run `wp --skip-plugins=akismet eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "sample_plugin" ) );'`
Then STDOUT should be:
"""
falsetrue
"""
# Can specify multiple plugins to skip
When I try `WP_CLI_ERROR_RERUN=no wp eval --skip-plugins=sample-plugin,akismet "echo sample_plugin();"`
Then STDERR should contain:
"""
Call to undefined function sample_plugin()
"""
# No plugins should be loaded when --skip-plugins doesn't have a value
When I run `wp --skip-plugins eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "sample_plugin" ) );'`
Then STDOUT should be:
"""
falsefalse
"""
Scenario: Skipping multiple plugins via config file
Given a WP installation
And I run `wp plugin install https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
And a wp-cli.yml file:
"""
skip-plugins:
- sample-plugin
- akismet
"""
When I run `wp plugin activate sample-plugin`
And I try `WP_CLI_ERROR_RERUN=no wp eval "echo sample_plugin();"`
Then STDERR should contain:
"""
Call to undefined function sample_plugin()
"""
Scenario: Skipping all plugins via config file
Given a WP installation
And I run `wp plugin install https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
And a wp-cli.yml file:
"""
skip-plugins: true
"""
When I run `wp plugin activate sample-plugin`
And I try `WP_CLI_ERROR_RERUN=no wp eval "echo sample_plugin();"`
Then STDERR should contain:
"""
Call to undefined function sample_plugin()
"""
Scenario: Skip network active plugins
Given a WP multisite installation
And I run `wp plugin install https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
When I try `wp plugin deactivate akismet sample-plugin`
Then STDERR should be:
"""
Warning: Plugin 'akismet' isn't active.
Warning: Plugin 'sample-plugin' isn't active.
"""
And STDOUT should be:
"""
Success: Plugins already deactivated.
"""
And the return code should be 0
When I run `wp plugin activate --network akismet sample-plugin`
And I run `wp eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "sample_plugin" ) );'`
Then STDOUT should be:
"""
truetrue
"""
When I run `wp --skip-plugins eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "sample_plugin" ) );'`
Then STDOUT should be:
"""
falsefalse
"""
When I run `wp --skip-plugins=akismet eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "sample_plugin" ) );'`
Then STDOUT should be:
"""
falsetrue
"""
When I run `wp --skip-plugins=sample-plugin eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "sample_plugin" ) );'`
Then STDOUT should be:
"""
truefalse
"""