@@ -19,26 +19,26 @@ Feature: Delete WordPress themes
1919
2020 When I try `wp theme delete p2`
2121 Then STDERR should be:
22- """
23- Warning: Can't delete the currently active theme: p2
24- Error: No themes deleted.
25- """
22+ """
23+ Warning: Can't delete the currently active theme: p2
24+ Error: No themes deleted.
25+ """
2626
2727 When I try `wp theme delete p2 --force`
2828 Then STDOUT should contain:
29- """
30- Deleted 'p2' theme.
31- """
29+ """
30+ Deleted 'p2' theme.
31+ """
3232
3333 Scenario : Delete all installed themes
3434 When I run `wp theme list --status=active --field=name --porcelain`
3535 And save STDOUT as {ACTIVE_THEME}
3636
3737 When I try `wp theme delete --all`
3838 Then STDOUT should contain:
39- """
40- Success: Deleted
41- """
39+ """
40+ Success: Deleted
41+ """
4242 And STDERR should be empty
4343
4444 When I run `wp theme delete --all --force`
@@ -50,9 +50,62 @@ Feature: Delete WordPress themes
5050
5151 When I try the previous command again
5252 Then STDOUT should be:
53- """
54- Success: No themes deleted.
55- """
53+ """
54+ Success: No themes deleted.
55+ """
56+
57+ Scenario : Delete all installed themes when active theme has a parent
58+ Given a WP install
59+ And I run `wp theme install moina-blog --activate`
60+
61+ When I run `wp theme list --field=name`
62+ Then STDOUT should contain:
63+ """
64+ moina-blog
65+ moina
66+ """
67+
68+ When I try `wp theme delete moina-blog`
69+ Then STDERR should contain:
70+ """
71+ Can't delete the currently active theme
72+ """
73+ And STDERR should contain:
74+ """
75+ Error: No themes deleted.
76+ """
77+
78+ When I try `wp theme delete moina`
79+ Then STDERR should contain:
80+ """
81+ Can't delete the parent of the currently active theme
82+ """
83+ And STDERR should contain:
84+ """
85+ Error: No themes deleted.
86+ """
87+
88+ When I run `wp theme delete --all`
89+ Then STDOUT should contain:
90+ """
91+ Success: Deleted
92+ """
93+
94+ When I run `wp theme list --field=name`
95+ Then STDOUT should contain:
96+ """
97+ moina-blog
98+ moina
99+ """
100+
101+ When I run `wp theme delete --all --force`
102+ Then STDOUT should contain:
103+ """
104+ Success: Deleted
105+ """
106+
107+ When I run `wp theme list --field=name`
108+ Then STDOUT should be empty
56109
57110 Scenario : Attempting to delete a theme that doesn't exist
58111 When I run `wp theme delete p2`
0 commit comments