Skip to content

Commit 6401d7e

Browse files
authored
Merge pull request #311 from wp-cli/fix/broken-theme-tests
Ensure bundled themes don't interfere with update tests
2 parents 130b61d + ba0f282 commit 6401d7e

File tree

2 files changed

+31
-10
lines changed

2 files changed

+31
-10
lines changed

features/theme.feature

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ Feature: Manage WordPress themes
8585
When I run `wp theme activate p2`
8686
Then STDOUT should not be empty
8787

88+
# Ensure no other themes interfere with update.
89+
When I run `wp theme list --status=inactive --field=name | xargs wp theme delete`
90+
Then STDOUT should contain:
91+
"""
92+
Success: Deleted
93+
"""
94+
8895
When I run `wp theme install p2 --version=1.4.1 --force`
8996
Then STDOUT should not be empty
9097

@@ -120,19 +127,29 @@ Feature: Manage WordPress themes
120127

121128
When I run `wp theme install p2 --version=1.4.1 --force`
122129
Then STDOUT should contain:
123-
""""
130+
"""
124131
Downloading install
125-
""""
132+
"""
126133
And STDOUT should contain:
127-
""""
134+
"""
128135
package from https://downloads.wordpress.org/theme/p2.1.4.1.zip...
129-
""""
136+
"""
137+
138+
When I run `wp theme activate p2`
139+
Then STDOUT should not be empty
140+
141+
# Ensure no other themes interfere with update.
142+
When I run `wp theme list --status=inactive --field=name | xargs wp theme delete`
143+
Then STDOUT should contain:
144+
"""
145+
Success: Deleted
146+
"""
130147

131148
When I run `wp theme status p2`
132149
Then STDOUT should contain:
133-
""""
150+
"""
134151
Update available
135-
""""
152+
"""
136153

137154
When I run `wp theme update --all --exclude=p2 | grep 'Skipped'`
138155
Then STDOUT should contain:
@@ -142,9 +159,9 @@ Feature: Manage WordPress themes
142159

143160
When I run `wp theme status p2`
144161
Then STDOUT should contain:
145-
""""
162+
"""
146163
Update available
147-
""""
164+
"""
148165

149166
Scenario: Get the path of an installed theme
150167
Given a WP install

features/upgradables.feature

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ Feature: Manage WordPress themes and plugins
9090
"""
9191
And the {SUITE_CACHE_DIR}/<type>/<item>-{NEW_VERSION}.zip file should exist
9292

93-
When I run `wp <type> update --all`
94-
Then STDOUT should not be empty
93+
# This can throw warnings about versions being higher than expected.
94+
When I try `wp <type> update --all 2>&1`
95+
Then STDOUT should contain:
96+
"""
97+
updated
98+
"""
9599

96100
When I run `wp <type> status <item>`
97101
Then STDOUT should not contain:

0 commit comments

Comments
 (0)