@@ -11,6 +11,39 @@ Feature: Uninstall a WordPress plugin
11
11
Success: Uninstalled 1 of 1 plugins.
12
12
"""
13
13
And the return code should be 0
14
+ And STDERR should be empty
15
+ And the wp-content/plugins/akismet directory should not exist
16
+
17
+
18
+ Scenario : Uninstall an installed plugin but do not delete its files
19
+ When I run `wp plugin uninstall akismet --skip-delete`
20
+ Then STDOUT should be:
21
+ """
22
+ Ran uninstall procedure for 'akismet' plugin without deleting.
23
+ Success: Uninstalled 1 of 1 plugins.
24
+ """
25
+ And the return code should be 0
26
+ And STDERR should be empty
27
+ And the wp-content/plugins/akismet directory should exist
28
+
29
+ Scenario : Uninstall a plugin that is not in a folder and has custom name
30
+ When I run `wp plugin uninstall hello`
31
+ Then STDOUT should be:
32
+ """
33
+ Uninstalled and deleted 'hello' plugin.
34
+ Success: Uninstalled 1 of 1 plugins.
35
+ """
36
+ And the return code should be 0
37
+ And STDERR should be empty
38
+ And the wp-content/plugins/hello.php file should not exist
39
+
40
+ Scenario : Missing required inputs
41
+ When I run `wp plugin uninstall`
42
+ Then STDOUT should be:
43
+ """
44
+ Please specify one or more plugins, or use --all.
45
+ """
46
+ And the return code should be 1
14
47
15
48
Scenario : Attempting to uninstall a plugin that's activated
16
49
When I run `wp plugin activate akismet`
@@ -25,6 +58,19 @@ Feature: Uninstall a WordPress plugin
25
58
And STDOUT should be empty
26
59
And the return code should be 1
27
60
61
+ Scenario : Attempting to uninstall a plugin that's activated (using --deactivate)
62
+ When I run `wp plugin activate akismet`
63
+ Then STDOUT should not be empty
64
+
65
+ When I try `wp plugin uninstall akismet --deactivate`
66
+ Then STDOUT should be:
67
+ """
68
+ Uninstalled and deleted 'akismet' plugin.
69
+ Success: Uninstalled 1 of 1 plugins.
70
+ """
71
+ And STDERR should be empty
72
+ And the return code should be 0
73
+
28
74
Scenario : Attempting to uninstall a plugin that doesn't exist
29
75
When I try `wp plugin uninstall debug-bar`
30
76
Then STDERR should be:
@@ -43,12 +89,14 @@ Feature: Uninstall a WordPress plugin
43
89
Success: Uninstalled 2 of 2 plugins.
44
90
"""
45
91
And the return code should be 0
92
+ And STDERR should be empty
46
93
47
94
When I run the previous command again
48
95
Then STDOUT should be:
49
96
"""
50
97
Success: No plugins uninstalled.
51
98
"""
99
+ And STDERR should be empty
52
100
53
101
Scenario : Uninstall all installed plugins when one or more activated
54
102
When I run `wp plugin activate --all`
@@ -65,12 +113,14 @@ Feature: Uninstall a WordPress plugin
65
113
Error: No plugins uninstalled.
66
114
"""
67
115
And the return code should be 1
116
+ And STDOUT should be empty
68
117
69
118
When I run `wp plugin uninstall --deactivate --all`
70
119
Then STDOUT should contain:
71
120
"""
72
121
Success: Uninstalled 2 of 2 plugins.
73
122
"""
123
+ And STDERR should be empty
74
124
75
125
Scenario : Excluding a plugin from uninstallation when using --all switch
76
126
When I try `wp plugin uninstall --all --exclude=akismet,hello`
@@ -79,6 +129,7 @@ Feature: Uninstall a WordPress plugin
79
129
Success: No plugins uninstalled.
80
130
"""
81
131
And the return code should be 0
132
+ And STDERR should be empty
82
133
83
134
Scenario : Excluding a missing plugin should not throw an error
84
135
Given a WP install
@@ -104,6 +155,7 @@ Feature: Uninstall a WordPress plugin
104
155
"""
105
156
And the wp-content/languages/plugins/wordpress-importer-fr_FR.mo file should exist
106
157
And the wp-content/languages/plugins/wordpress-importer-fr_FR.po file should exist
158
+ And the wp-content/languages/plugins/wordpress-importer-fr_FR.l10n.php file should exist
107
159
108
160
When I run `wp plugin uninstall wordpress-importer`
109
161
Then STDOUT should contain:
@@ -112,3 +164,5 @@ Feature: Uninstall a WordPress plugin
112
164
"""
113
165
And the wp-content/languages/plugins/wordpress-importer-fr_FR.mo file should not exist
114
166
And the wp-content/languages/plugins/wordpress-importer-fr_FR.po file should not exist
167
+ And the wp-content/languages/plugins/wordpress-importer-fr_FR.l10n.php file should not exist
168
+ And STDERR should be empty
0 commit comments