FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
extension-command/features/theme-delete.feature at main · wp-cli/extension-command · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
wp-cli
/
extension-command
Public
Notifications
You must be signed in to change notification settings
Fork
87
Star
90
Code
Issues
2
Pull requests
2
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
extension-command
/
features
/
theme-delete.feature
Copy path
More file actions
More file actions
Latest commit
History
History
History
125 lines (106 loc) · 3.05 KB
Breadcrumbs
extension-command
/
features
/
theme-delete.feature
Copy path
File metadata and controls
125 lines (106 loc) · 3.05 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
Feature
:
Delete WordPress themes
Background
:
Given
a WP install
And
I run `wp theme delete --all --force`
And
I run `wp theme install twentytwelve`
And
I run `wp theme install twentyeleven --activate`
Scenario
:
Delete an installed theme
When
I run `wp theme delete twentytwelve`
Then
STDOUT should be:
"""
Deleted 'twentytwelve' theme.
Success: Deleted 1 of 1 themes.
"""
And
the return code should be 0
Scenario
:
Delete an active theme
When
I run `wp theme activate twentytwelve`
Then
STDOUT should not be empty
When
I try `wp theme delete twentytwelve`
Then
STDERR should be:
"""
Warning: Can't delete the currently active theme: twentytwelve
Error: No themes deleted.
"""
When
I try `wp theme delete twentytwelve --force`
Then
STDOUT should contain:
"""
Deleted 'twentytwelve' theme.
"""
Scenario
:
Delete all installed themes
When
I run `wp theme list --status=active --field=name --porcelain`
Then
save STDOUT as {ACTIVE_THEME}
When
I try `wp theme delete --all`
Then
STDOUT should contain:
"""
Success: Deleted
"""
And
STDERR should be empty
When
I run `wp theme delete --all --force`
Then
STDOUT should be:
"""
Deleted '{ACTIVE_THEME}' theme.
Success: Deleted 1 of 1 themes.
"""
When
I try the previous command again
Then
STDOUT should be:
"""
Success: No themes deleted.
"""
Scenario
:
Delete all installed themes when active theme has a parent
Given
a WP install
And
I run `wp theme install oceanly-green --activate`
When
I run `wp theme list --field=name`
Then
STDOUT should contain:
"""
oceanly-green
oceanly
"""
When
I try `wp theme delete oceanly-green`
Then
STDERR should contain:
"""
Can't delete the currently active theme
"""
And
STDERR should contain:
"""
Error: No themes deleted.
"""
When
I try `wp theme delete oceanly`
Then
STDERR should contain:
"""
Can't delete the parent of the currently active theme
"""
And
STDERR should contain:
"""
Error: No themes deleted.
"""
When
I run `wp theme delete --all`
Then
STDOUT should contain:
"""
Success: Deleted
"""
When
I run `wp theme list --field=name`
Then
STDOUT should contain:
"""
oceanly-green
oceanly
"""
When
I run `wp theme delete --all --force`
Then
STDOUT should contain:
"""
Success: Deleted
"""
When
I run `wp theme list --field=name`
Then
STDOUT should be empty
Scenario
:
Attempting to delete a theme that doesn't exist
When
I run `wp theme delete twentytwelve`
Then
STDOUT should not be empty
When
I try the previous command again
Then
STDOUT should be:
"""
Success: Theme already deleted.
"""
And
STDERR should be:
"""
Warning: The 'twentytwelve' theme could not be found.
"""
And
the return code should be 0
Back
|
FazBrowse Home
|
New Git URL