@@ -3,14 +3,47 @@ Feature: Uninstall a WordPress plugin
33 Background :
44 Given a WP install
55
6- Scenario : Uninstall an installed plugin
6+ Scenario : Uninstall an installed plugin should uninstall, delete files
77 When I run `wp plugin uninstall akismet`
88 Then STDOUT should be:
99 """
1010 Uninstalled and deleted 'akismet' plugin.
1111 Success: Uninstalled 1 of 1 plugins.
1212 """
1313 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+ Scenario : Uninstall an installed plugin but do not delete its files
18+ When I run `wp plugin uninstall akismet --skip-delete`
19+ Then STDOUT should be:
20+ """
21+ Ran uninstall procedure for 'akismet' plugin without deleting.
22+ Success: Uninstalled 1 of 1 plugins.
23+ """
24+ And the return code should be 0
25+ And STDERR should be empty
26+ And the wp-content/plugins/akismet directory should exist
27+
28+ Scenario : Uninstall a plugin that is not in a folder and has custom name
29+ When I run `wp plugin uninstall hello`
30+ Then STDOUT should be:
31+ """
32+ Uninstalled and deleted 'hello' plugin.
33+ Success: Uninstalled 1 of 1 plugins.
34+ """
35+ And the return code should be 0
36+ And STDERR should be empty
37+ And the wp-content/plugins/hello.php file should not exist
38+
39+ Scenario : Missing required inputs
40+ When I try `wp plugin uninstall`
41+ Then STDERR should be:
42+ """
43+ Error: Please specify one or more plugins, or use --all.
44+ """
45+ And the return code should be 1
46+ And STDOUT should be empty
1447
1548 Scenario : Attempting to uninstall a plugin that's activated
1649 When I run `wp plugin activate akismet`
@@ -25,6 +58,21 @@ Feature: Uninstall a WordPress plugin
2558 And STDOUT should be empty
2659 And the return code should be 1
2760
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+ Deactivating 'akismet'...
69+ Plugin 'akismet' deactivated.
70+ Uninstalled and deleted 'akismet' plugin.
71+ Success: Uninstalled 1 of 1 plugins.
72+ """
73+ And STDERR should be empty
74+ And the return code should be 0
75+
2876 Scenario : Attempting to uninstall a plugin that doesn't exist
2977 When I try `wp plugin uninstall debug-bar`
3078 Then STDERR should be:
@@ -43,12 +91,14 @@ Feature: Uninstall a WordPress plugin
4391 Success: Uninstalled 2 of 2 plugins.
4492 """
4593 And the return code should be 0
94+ And STDERR should be empty
4695
4796 When I run the previous command again
4897 Then STDOUT should be:
4998 """
5099 Success: No plugins uninstalled.
51100 """
101+ And STDERR should be empty
52102
53103 Scenario : Uninstall all installed plugins when one or more activated
54104 When I run `wp plugin activate --all`
@@ -65,12 +115,14 @@ Feature: Uninstall a WordPress plugin
65115 Error: No plugins uninstalled.
66116 """
67117 And the return code should be 1
118+ And STDOUT should be empty
68119
69120 When I run `wp plugin uninstall --deactivate --all`
70121 Then STDOUT should contain:
71122 """
72123 Success: Uninstalled 2 of 2 plugins.
73124 """
125+ And STDERR should be empty
74126
75127 Scenario : Excluding a plugin from uninstallation when using --all switch
76128 When I try `wp plugin uninstall --all --exclude=akismet,hello`
@@ -79,6 +131,7 @@ Feature: Uninstall a WordPress plugin
79131 Success: No plugins uninstalled.
80132 """
81133 And the return code should be 0
134+ And STDERR should be empty
82135
83136 Scenario : Excluding a missing plugin should not throw an error
84137 Given a WP install
@@ -91,7 +144,7 @@ Feature: Uninstall a WordPress plugin
91144 And the return code should be 0
92145
93146 @require-wp-5.2
94- Scenario : Uninstalling a plugin should remove its language pack too
147+ Scenario : Uninstalling a plugin should remove its language pack
95148 Given a WP install
96149 And I run `wp plugin install wordpress-importer`
97150 And I run `wp core language install fr_FR`
@@ -104,6 +157,7 @@ Feature: Uninstall a WordPress plugin
104157 """
105158 And the wp-content/languages/plugins/wordpress-importer-fr_FR.mo file should exist
106159 And the wp-content/languages/plugins/wordpress-importer-fr_FR.po file should exist
160+ And the wp-content/languages/plugins/wordpress-importer-fr_FR.l10n.php file should exist
107161
108162 When I run `wp plugin uninstall wordpress-importer`
109163 Then STDOUT should contain:
@@ -112,3 +166,29 @@ Feature: Uninstall a WordPress plugin
112166 """
113167 And the wp-content/languages/plugins/wordpress-importer-fr_FR.mo file should not exist
114168 And the wp-content/languages/plugins/wordpress-importer-fr_FR.po file should not exist
169+ And the wp-content/languages/plugins/wordpress-importer-fr_FR.l10n.php file should not exist
170+ And STDERR should be empty
171+
172+ @require-wp-5.2
173+ Scenario : Uninstalling a plugin should remove its update info
174+ Given a WP install
175+ And I run `wp plugin install wordpress-importer --version=0.6`
176+ And I run `wp plugin status wordpress-importer`
177+
178+ And I run `wp transient get --network update_plugins`
179+ Then STDOUT should contain:
180+ """
181+ wordpress-importer
182+ """
183+
184+ When I run `wp plugin uninstall wordpress-importer`
185+ Then STDOUT should contain:
186+ """
187+ Success:
188+ """
189+
190+ When I run `wp transient get --network update_plugins`
191+ Then STDOUT should not contain:
192+ """
193+ wordpress-importer
194+ """
0 commit comments