forked from wp-cli/wp-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathskip-plugins.feature
More file actions
116 lines (99 loc) · 3.35 KB
/
skip-plugins.feature
File metadata and controls
116 lines (99 loc) · 3.35 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
Feature: Skipping plugins
Scenario: Skipping plugins via global flag
Given a WP installation
And I run `wp plugin activate hello akismet`
When I run `wp eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'`
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( "hello_dolly" ) );'`
Then STDOUT should be:
"""
falsetrue
"""
# Can specify multiple plugins to skip
When I try `wp eval --skip-plugins=hello,akismet 'echo hello_dolly();'`
Then STDERR should contain:
"""
Call to undefined function hello_dolly()
"""
# 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( "hello_dolly" ) );'`
Then STDOUT should be:
"""
falsefalse
"""
Scenario: Skipping multiple plugins via config file
Given a WP installation
And a wp-cli.yml file:
"""
skip-plugins:
- hello
- akismet
"""
When I run `wp plugin activate hello`
And I try `wp eval 'echo hello_dolly();'`
Then STDERR should contain:
"""
Call to undefined function hello_dolly()
"""
Scenario: Skipping all plugins via config file
Given a WP installation
And a wp-cli.yml file:
"""
skip-plugins: true
"""
When I run `wp plugin activate hello`
And I try `wp eval 'echo hello_dolly();'`
Then STDERR should contain:
"""
Call to undefined function hello_dolly()
"""
Scenario: Skip network active plugins
Given a WP multisite installation
When I try `wp plugin deactivate akismet hello`
Then STDERR should be:
"""
Warning: Plugin 'akismet' isn't active.
Warning: Plugin 'hello' 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 hello`
And I run `wp eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'`
Then STDOUT should be:
"""
truetrue
"""
When I run `wp --skip-plugins eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'`
Then STDOUT should be:
"""
falsefalse
"""
When I run `wp --skip-plugins=akismet eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'`
Then STDOUT should be:
"""
falsetrue
"""
When I run `wp --skip-plugins=hello eval 'var_export( defined("AKISMET_VERSION") );var_export( function_exists( "hello_dolly" ) );'`
Then STDOUT should be:
"""
truefalse
"""