Skip to content

Commit 87c9e33

Browse files
authored
Merge pull request #293 from wp-cli/fix-broken-tests
Fix test issues
2 parents ef614ce + 0b063b4 commit 87c9e33

File tree

4 files changed

+29
-19
lines changed

4 files changed

+29
-19
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
],
1919
"require": {
2020
"composer/semver": "^1.4 || ^2 || ^3",
21-
"wp-cli/wp-cli": "^2.5"
21+
"wp-cli/wp-cli": "^2.5.1"
2222
},
2323
"require-dev": {
2424
"wp-cli/entity-command": "^1.3 || ^2",
2525
"wp-cli/scaffold-command": "^1.2 || ^2",
26-
"wp-cli/wp-cli-tests": "^3.0.11"
26+
"wp-cli/wp-cli-tests": "^3.0.16"
2727
},
2828
"config": {
2929
"process-timeout": 7200,

features/plugin-update.feature

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ Feature: Update WordPress plugins
5050

5151
When I run `wp plugin install wordpress-importer --version=0.5 --force`
5252
Then STDOUT should contain:
53-
""""
53+
"""
5454
Downloading install
55-
""""
55+
"""
5656
And STDOUT should contain:
57-
""""
57+
"""
5858
package from https://downloads.wordpress.org/plugin/wordpress-importer.0.5.zip...
59-
""""
59+
"""
6060

6161
When I run `wp plugin status wordpress-importer`
6262
Then STDOUT should contain:
63-
""""
63+
"""
6464
Update available
65-
""""
65+
"""
6666

6767
When I run `wp plugin update --all --exclude=wordpress-importer | grep 'Skipped'`
6868
Then STDOUT should contain:
@@ -72,9 +72,9 @@ Feature: Update WordPress plugins
7272

7373
When I run `wp plugin status wordpress-importer`
7474
Then STDOUT should contain:
75-
""""
75+
"""
7676
Update available
77-
""""
77+
"""
7878

7979
Scenario: Update a plugin to its latest patch release
8080
Given a WP install
@@ -196,15 +196,25 @@ Feature: Update WordPress plugins
196196
Scenario: Plugin updates that error should not report a success
197197
Given a WP install
198198
And I run `wp plugin install --force akismet --version=4.0`
199-
And I run `chmod -w wp-content/plugins/akismet`
199+
200+
When I run `chmod -w wp-content/plugins/akismet`
200201
And I try `wp plugin update akismet`
201-
And save STDERR as {ERROR}
202-
And I run `chmod +w wp-content/plugins/akismet`
202+
Then STDERR should contain:
203+
"""
204+
Error:
205+
"""
206+
Then STDOUT should not contain:
207+
"""
208+
Success:
209+
"""
203210

204-
And I run `echo "{ERROR}"`
211+
When I run `chmod +w wp-content/plugins/akismet`
212+
And I try `wp plugin update akismet`
213+
Then STDERR should not contain:
214+
"""
215+
Error:
216+
"""
205217
Then STDOUT should contain:
206218
"""
207-
Error:
219+
Success:
208220
"""
209-
210-

features/plugin.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Feature: Manage WordPress plugins
171171
"""
172172
Warning: The 'xxx' plugin could not be found.
173173
"""
174-
Then STDERR should contain:
174+
And STDERR should contain:
175175
"""
176176
Warning: The 'yyy' plugin could not be found.
177177
"""

src/WP_CLI/CommandWithUpgrade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ protected function update_many( $args, $assoc_args ) {
320320
call_user_func( $this->upgrade_refresh );
321321

322322
if ( ! empty( $assoc_args['format'] ) && in_array( $assoc_args['format'], [ 'json', 'csv' ], true ) ) {
323-
$logger = new Loggers\Quiet();
323+
$logger = new Loggers\Quiet( WP_CLI::get_runner()->in_color() );
324324
WP_CLI::set_logger( $logger );
325325
}
326326

0 commit comments

Comments
 (0)