-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathplugin-auto-updates-status.feature
More file actions
139 lines (122 loc) · 4.49 KB
/
plugin-auto-updates-status.feature
File metadata and controls
139 lines (122 loc) · 4.49 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
Feature: Show the status of auto-updates for WordPress plugins
Background:
Given a WP install
And I run `wp plugin install duplicate-post https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip --ignore-requirements`
@require-wp-5.5
Scenario: Show an error if required params are missing
When I try `wp plugin auto-updates status`
Then STDOUT should be empty
And STDERR should contain:
"""
Error: Please specify one or more plugins, or use --all.
"""
@require-wp-5.5
Scenario: Show the status of auto-updates of a single plugin
When I run `wp plugin auto-updates status sample-plugin`
Then STDOUT should be a table containing rows:
| name | status |
| sample-plugin | disabled |
And the return code should be 0
@require-wp-5.5
Scenario: Show the status of auto-updates multiple plugins
When I run `wp plugin auto-updates status duplicate-post sample-plugin`
Then STDOUT should be a table containing rows:
| name | status |
| duplicate-post | disabled |
| sample-plugin | disabled |
And the return code should be 0
@require-wp-5.5
Scenario: Show the status of auto-updates all installed plugins
When I run `wp plugin auto-updates status --all`
Then STDOUT should be a table containing rows:
| name | status |
| akismet | disabled |
| duplicate-post | disabled |
| sample-plugin | disabled |
And the return code should be 0
When I run `wp plugin auto-updates enable --all`
And I run `wp plugin auto-updates status --all`
Then STDOUT should be a table containing rows:
| name | status |
| akismet | enabled |
| duplicate-post | enabled |
| sample-plugin | enabled |
And the return code should be 0
@require-wp-5.5
Scenario: The status can be filtered to only show enabled or disabled plugins
Given I run `wp plugin auto-updates enable sample-plugin`
When I run `wp plugin auto-updates status --all`
Then STDOUT should be a table containing rows:
| name | status |
| akismet | disabled |
| duplicate-post | disabled |
| sample-plugin | enabled |
And the return code should be 0
When I run `wp plugin auto-updates status --all --enabled-only`
Then STDOUT should be a table containing rows:
| name | status |
| sample-plugin | enabled |
And the return code should be 0
When I run `wp plugin auto-updates status --all --disabled-only`
Then STDOUT should be a table containing rows:
| name | status |
| akismet | disabled |
| duplicate-post | disabled |
And the return code should be 0
When I try `wp plugin auto-updates status --all --enabled-only --disabled-only`
Then STDOUT should be empty
And STDERR should contain:
"""
Error: --enabled-only and --disabled-only are mutually exclusive and cannot be used at the same time.
"""
@require-wp-5.5
Scenario: The fields can be shown individually
Given I run `wp plugin auto-updates enable sample-plugin`
When I run `wp plugin auto-updates status --all --disabled-only --field=name`
Then STDOUT should contain:
"""
akismet
"""
And STDOUT should contain:
"""
duplicate-post
"""
When I run `wp plugin auto-updates status sample-plugin --field=status`
Then STDOUT should be:
"""
enabled
"""
@require-wp-5.5
Scenario: Formatting options work
When I run `wp plugin auto-updates status --all --format=json`
Then STDOUT should contain:
"""
{"name":"akismet","status":"disabled"}
"""
And STDOUT should contain:
"""
{"name":"sample-plugin","status":"disabled"}
"""
And STDOUT should contain:
"""
{"name":"duplicate-post","status":"disabled"}
"""
When I run `wp plugin auto-updates status --all --format=csv`
Then STDOUT should contain:
"""
akismet,disabled
"""
And STDOUT should contain:
"""
sample-plugin,disabled
"""
And STDOUT should contain:
"""
duplicate-post,disabled
"""
@require-wp-5.5
Scenario: Handle malformed option value
When I run `wp option update auto_update_plugins ""`
And I try `wp plugin auto-updates status sample-plugin`
Then the return code should be 0
And STDERR should be empty