Skip to content

Commit 93b5c83

Browse files
committed
Update theme from p2 to twentytwelve
1 parent 402d758 commit 93b5c83

File tree

4 files changed

+91
-80
lines changed

4 files changed

+91
-80
lines changed

features/theme-delete.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@ Feature: Delete WordPress themes
22

33
Background:
44
Given a WP install
5-
And I run `wp theme install twentytwelve`
5+
And I run `wp theme install twentytwelve --force`
66

77
Scenario: Delete an installed theme
8-
When I run `wp theme delete p2`
8+
When I run `wp theme delete twentytwelve`
99
Then STDOUT should be:
1010
"""
11-
Deleted 'p2' theme.
11+
Deleted 'twentytwelve' theme.
1212
Success: Deleted 1 of 1 themes.
1313
"""
1414
And the return code should be 0
1515

1616
Scenario: Delete an active theme
17-
When I run `wp theme activate p2`
17+
When I run `wp theme activate twentytwelve`
1818
Then STDOUT should not be empty
1919

20-
When I try `wp theme delete p2`
20+
When I try `wp theme delete twentytwelve`
2121
Then STDERR should be:
2222
"""
23-
Warning: Can't delete the currently active theme: p2
23+
Warning: Can't delete the currently active theme: twentytwelve
2424
Error: No themes deleted.
2525
"""
2626

27-
When I try `wp theme delete p2 --force`
27+
When I try `wp theme delete twentytwelve --force`
2828
Then STDOUT should contain:
2929
"""
30-
Deleted 'p2' theme.
30+
Deleted 'twentytwelve' theme.
3131
"""
3232

3333
Scenario: Delete all installed themes
@@ -108,7 +108,7 @@ Feature: Delete WordPress themes
108108
Then STDOUT should be empty
109109

110110
Scenario: Attempting to delete a theme that doesn't exist
111-
When I run `wp theme delete p2`
111+
When I run `wp theme delete twentytwelve`
112112
Then STDOUT should not be empty
113113

114114
When I try the previous command again
@@ -118,6 +118,6 @@ Feature: Delete WordPress themes
118118
"""
119119
And STDERR should be:
120120
"""
121-
Warning: The 'p2' theme could not be found.
121+
Warning: The 'twentytwelve' theme could not be found.
122122
"""
123123
And the return code should be 0

features/theme-install.feature

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
Feature: Install WordPress themes
22

3-
Scenario: Return code is 1 when one or more theme installations fail
3+
Background:
44
Given a WP install
5+
And I try `wp theme delete twentytwelve --force`
56

6-
When I try `wp theme install twentytwelve p2-not-a-theme`
7+
Scenario: Return code is 1 when one or more theme installations fail
8+
When I try `wp theme install twentytwelve twentytwelve-not-a-theme`
79
Then STDERR should contain:
810
"""
911
Warning:
1012
"""
1113
And STDERR should contain:
1214
"""
13-
p2-not-a-theme
15+
twentytwelve-not-a-theme
1416
"""
1517
And STDERR should contain:
1618
"""
1719
Error: Only installed 1 of 2 themes.
1820
"""
1921
And STDOUT should contain:
2022
"""
21-
Installing P2
23+
Installing Twenty Twelve
2224
"""
2325
And STDOUT should contain:
2426
"""
@@ -33,7 +35,7 @@ Feature: Install WordPress themes
3335
"""
3436
And STDERR should be:
3537
"""
36-
Warning: p2: Theme already installed.
38+
Warning: twentytwelve: Theme already installed.
3739
"""
3840
And the return code should be 0
3941

@@ -44,7 +46,7 @@ Feature: Install WordPress themes
4446
"""
4547
And STDERR should contain:
4648
"""
47-
p2-not-a-theme
49+
twentytwelve-not-a-theme
4850
"""
4951
And STDERR should contain:
5052
"""
@@ -88,20 +90,18 @@ Feature: Install WordPress themes
8890
"""
8991

9092
Scenario: Verify installed theme activation
91-
Given a WP install
92-
9393
When I run `wp theme install twentytwelve`
9494
Then STDOUT should not be empty
9595

9696
When I try `wp theme install twentytwelve --activate`
9797
Then STDERR should contain:
9898
"""
99-
Warning: p2: Theme already installed.
99+
Warning: twentytwelve: Theme already installed.
100100
"""
101101

102102
And STDOUT should contain:
103103
"""
104-
Activating 'p2'...
105-
Success: Switched to 'P2' theme.
104+
Activating 'twentytwelve'...
105+
Success: Switched to 'Twenty Twelve' theme.
106106
Success: Theme already installed.
107107
"""

features/theme-update.feature

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,18 @@ Feature: Update WordPress themes
1919

2020
Scenario: Install a theme, then update to a specific version of that theme
2121
Given a WP install
22+
And I run `wp theme delete twentytwelve --force`
2223

23-
When I run `wp theme install twentytwelve --version=1.4.1`
24+
When I run `wp theme install twentytwelve --version=3.0`
2425
Then STDOUT should not be empty
2526

26-
When I run `wp theme update p2 --version=1.4.2`
27+
When I run `wp theme update twentytwelve --version=4.0`
2728
Then STDOUT should not be empty
2829

2930
When I run `wp theme list --fields=name,version`
3031
Then STDOUT should be a table containing rows:
31-
| name | version |
32-
| p2 | 1.4.2 |
32+
| name | version |
33+
| twentytwelve | 4.0 |
3334

3435
Scenario: Not giving a slug on update should throw an error unless --all given
3536
Given a WP install
@@ -51,7 +52,7 @@ Feature: Update WordPress themes
5152
"""
5253

5354
# One theme installed.
54-
Given I run `wp theme install twentytwelve --version=1.4.2`
55+
Given I run `wp theme install twentytwelve --version=1.4`
5556

5657
When I try `wp theme update`
5758
Then the return code should be 1
@@ -74,7 +75,7 @@ Feature: Update WordPress themes
7475
"""
7576

7677
# Note: if given version then re-installs.
77-
When I run `wp theme update --version=1.4.2 --all`
78+
When I run `wp theme update --version=1.4 --all`
7879
Then STDOUT should contain:
7980
"""
8081
Success: Installed 1 of 1 themes.
@@ -87,7 +88,7 @@ Feature: Update WordPress themes
8788
"""
8889

8990
# Two themes installed.
90-
Given I run `wp theme install --force twentytwelve --version=1.0`
91+
Given I run `wp theme install --force twentytwentyfour --version=1.1`
9192

9293
When I run `wp theme update --all`
9394
Then STDOUT should contain:
@@ -103,15 +104,16 @@ Feature: Update WordPress themes
103104
"""
104105

105106
# Using version with all rarely makes sense and should probably error and do nothing.
106-
When I try `wp theme update --version=1.4.2 --all`
107+
# Version 1.1.1 is available for twentytwelve but not for twentytwentyfour.
108+
When I try `wp theme update --version=1.1.1 --all`
107109
Then the return code should be 1
108110
And STDOUT should contain:
109111
"""
110112
Success: Installed 1 of 1 themes.
111113
"""
112114
And STDERR should be:
113115
"""
114-
Error: Can't find the requested theme's version 1.4.2 in the WordPress.org theme repository (HTTP code 404).
116+
Error: Can't find the requested theme's version 1.1.1 in the WordPress.org theme repository (HTTP code 404).
115117
"""
116118

117119
Scenario: Error when both --minor and --patch are provided

0 commit comments

Comments
 (0)