Skip to content

Commit 5a4bfac

Browse files
Merge pull request #85 from wp-cli/fix-plugin-install-upgradables-tests
Allow for modern-wordpress redirect; explicit list not search in upgr…
2 parents dfacef0 + 09bac0e commit 5a4bfac

3 files changed

Lines changed: 46 additions & 17 deletions

File tree

features/plugin-install.feature

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ Feature: Install WordPress plugins
5050
"""
5151
Plugin installed successfully.
5252
"""
53-
And STDOUT should contain:
54-
"""
55-
Renamed Github-based project from 'modern-wordpress-master' to 'modern-wordpress'.
56-
"""
53+
And STDOUT should match /Renamed Github-based project from 'modern-(?:wordpress|framework)-master' to 'modern-wordpress'/
5754
# Wrong directory.
5855
And the wp-content/plugins/modern-wordpress directory should exist
5956
And the wp-content/plugins/modern-framework directory should not exist
@@ -117,9 +114,16 @@ Feature: Install WordPress plugins
117114
Given a WP install
118115

119116
When I try `wp plugin install user-switching user-switching-not-a-plugin`
120-
Then STDERR should be:
117+
Then STDERR should contain:
118+
"""
119+
Warning:
120+
"""
121+
And STDERR should contain:
122+
"""
123+
user-switching-not-a-plugin
124+
"""
125+
And STDERR should contain:
121126
"""
122-
Warning: Couldn't find 'user-switching-not-a-plugin' in the WordPress.org plugin directory.
123127
Error: Only installed 1 of 2 plugins.
124128
"""
125129
And STDOUT should contain:
@@ -144,9 +148,16 @@ Feature: Install WordPress plugins
144148
And the return code should be 0
145149

146150
When I try `wp plugin install user-switching-not-a-plugin`
147-
Then STDERR should be:
151+
Then STDERR should contain:
152+
"""
153+
Warning:
154+
"""
155+
And STDERR should contain:
156+
"""
157+
user-switching-not-a-plugin
158+
"""
159+
And STDERR should contain:
148160
"""
149-
Warning: Couldn't find 'user-switching-not-a-plugin' in the WordPress.org plugin directory.
150161
Error: No plugins installed.
151162
"""
152163
And the return code should be 1

features/theme-install.feature

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ Feature: Install WordPress themes
44
Given a WP install
55

66
When I try `wp theme install p2 p2-not-a-theme`
7-
Then STDERR should be:
7+
Then STDERR should contain:
8+
"""
9+
Warning:
10+
"""
11+
And STDERR should contain:
12+
"""
13+
p2-not-a-theme
14+
"""
15+
And STDERR should contain:
816
"""
9-
Warning: Couldn't find 'p2-not-a-theme' in the WordPress.org theme directory.
1017
Error: Only installed 1 of 2 themes.
1118
"""
1219
And STDOUT should contain:
@@ -31,9 +38,16 @@ Feature: Install WordPress themes
3138
And the return code should be 0
3239

3340
When I try `wp theme install p2-not-a-theme`
34-
Then STDERR should be:
41+
Then STDERR should contain:
42+
"""
43+
Warning:
44+
"""
45+
And STDERR should contain:
46+
"""
47+
p2-not-a-theme
48+
"""
49+
And STDERR should contain:
3550
"""
36-
Warning: Couldn't find 'p2-not-a-theme' in the WordPress.org theme directory.
3751
Error: No themes installed.
3852
"""
3953
And STDOUT should be empty

features/upgradables.feature

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,22 @@ Feature: Manage WordPress themes and plugins
171171
"""
172172
And the <file_to_check> file should not exist
173173

174-
When I run `wp <type> search <item> --per-page=2 --fields=name,slug`
175-
Then STDOUT should contain:
174+
When I run `wp <type> list --fields=name`
175+
Then STDOUT should not contain:
176176
"""
177-
Showing 2 of
177+
<item>
178178
"""
179179

180180
When I try `wp <type> install an-impossible-slug-because-abc3fr`
181181
Then STDERR should contain:
182182
"""
183-
Warning: Couldn't find 'an-impossible-slug-because-abc3fr' in the WordPress.org <type> directory.
183+
Warning:
184184
"""
185-
Then STDERR should contain:
185+
And STDERR should contain:
186+
"""
187+
an-impossible-slug-because-abc3fr
188+
"""
189+
And STDERR should contain:
186190
"""
187191
Error: No <type>s installed.
188192
"""

0 commit comments

Comments
 (0)