-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathplugin-delete.feature
More file actions
96 lines (86 loc) · 2.45 KB
/
plugin-delete.feature
File metadata and controls
96 lines (86 loc) · 2.45 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
Feature: Delete WordPress plugins
Background:
Given a WP install
And I run `wp plugin install https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
Scenario: Delete an installed plugin
When I run `wp plugin delete akismet`
Then STDOUT should be:
"""
Deleted 'akismet' plugin.
Success: Deleted 1 of 1 plugins.
"""
And the return code should be 0
Scenario: Delete all installed plugins
When I run `wp plugin delete --all`
Then STDOUT should contain:
"""
Deleted 'akismet' plugin.
"""
And STDOUT should contain:
"""
Deleted 'sample-plugin' plugin.
"""
And STDOUT should contain:
"""
Success: Deleted 3 of 3 plugins.
"""
And the return code should be 0
When I run the previous command again
Then STDOUT should be:
"""
Success: No plugins deleted.
"""
Scenario: Attempting to delete a plugin that doesn't exist
When I try `wp plugin delete debug-bar`
Then STDOUT should be:
"""
Success: Plugin already deleted.
"""
And STDERR should be:
"""
Warning: The 'debug-bar' plugin could not be found.
"""
And the return code should be 0
Scenario: Excluding a plugin from deletion when using --all switch
When I try `wp plugin delete --all --exclude=akismet,sample-plugin,hello,hello-dolly`
Then STDOUT should be:
"""
Success: No plugins deleted.
"""
And the return code should be 0
Scenario: Excluding a missing plugin should not throw an error
Given a WP install
And I run `wp plugin delete --all --exclude=missing-plugin`
Then STDERR should be empty
And STDOUT should contain:
"""
Success:
"""
And the return code should be 0
@skip-windows
Scenario: Reports a failure for a plugin that can't be deleted
Given a WP install
When I run `chmod -w wp-content/plugins/akismet`
And I try `wp plugin delete akismet`
Then STDERR should contain:
"""
Warning: The 'akismet' plugin could not be deleted.
"""
And STDERR should contain:
"""
Error: No plugins deleted.
"""
And STDOUT should not contain:
"""
Success:
"""
When I run `chmod +w wp-content/plugins/akismet`
And I run `wp plugin delete akismet`
Then STDERR should not contain:
"""
Error:
"""
And STDOUT should contain:
"""
Success:
"""