Skip to content

Commit b62783b

Browse files
committed
Further improve tests
1 parent 9e248f1 commit b62783b

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

features/plugin-deactivate.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Feature: Deactivate WordPress plugins
9696
Then STDOUT should be:
9797
"""
9898
Plugin 'akismet' deactivated.
99-
Success: Deactivated 1 of 1 plugins.
99+
Success: Deactivated 1 of 2 plugins.
100100
"""
101101
And the return code should be 0
102102

features/plugin-update.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ Feature: Update WordPress plugins
2525

2626
When I run `wp plugin list`
2727
Then STDOUT should be a table containing rows:
28-
| name | status | update | version |
29-
| wordpress-importer | inactive | available | 0.5 |
28+
| name | status | update | version | auto_update |
29+
| wordpress-importer | inactive | available | 0.5 | off |
3030

3131
When I run `wp plugin update wordpress-importer`
3232
Then STDOUT should not be empty
3333

3434
When I run `wp plugin list`
3535
Then STDOUT should be a table containing rows:
36-
| name | status | update | version |
37-
| wordpress-importer | inactive | none | {UPDATE_VERSION} |
36+
| name | status | update | version | auto_update |
37+
| wordpress-importer | inactive | none | {UPDATE_VERSION} | off |
3838

3939
Scenario: Error when both --minor and --patch are provided
4040
Given a WP install

features/plugin.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ Feature: Manage WordPress plugins
683683

684684
When I run `wp plugin list`
685685
Then STDOUT should be a table containing rows:
686-
| name | status | update | version |
687-
| hello-dolly | inactive | version higher than expected | {PLUGIN_VERSION} |
686+
| name | status | update | version | auto_update |
687+
| hello-dolly | inactive | version higher than expected | {PLUGIN_VERSION} | off |
688688

689689
When I try `wp plugin update --all`
690690
Then STDERR should be:

features/theme.feature

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ Feature: Manage WordPress themes
7979

8080
When I run `wp theme list`
8181
Then STDOUT should be a table containing rows:
82-
| name | status | update | version |
83-
| p2 | inactive | available | 1.4.2 |
82+
| name | status | update | version | auto_update |
83+
| p2 | inactive | available | 1.4.2 | off |
8484

8585
When I run `wp theme activate p2`
8686
Then STDOUT should not be empty
@@ -97,8 +97,8 @@ Feature: Manage WordPress themes
9797

9898
When I run `wp theme list`
9999
Then STDOUT should be a table containing rows:
100-
| name | status | update | version |
101-
| p2 | active | available | 1.4.1 |
100+
| name | status | update | version | auto_update |
101+
| p2 | active | available | 1.4.1 | off |
102102

103103
When I try `wp theme update`
104104
Then STDERR should be:
@@ -217,8 +217,8 @@ Feature: Manage WordPress themes
217217

218218
When I run `wp theme list --fields=name,status,update --skip-update-check`
219219
Then STDOUT should be a table containing rows:
220-
| name | status | update |
221-
| astra | inactive | none |
220+
| name | status | update | auto_update |
221+
| astra | inactive | none | off |
222222

223223
Scenario: Install a theme when the theme directory doesn't yet exist
224224
Given a WP install
@@ -388,8 +388,8 @@ Feature: Manage WordPress themes
388388
When I try `wp theme list --fields=name,status`
389389
Then STDOUT should be a table containing rows:
390390
| name | status |
391-
| moina-blog | active |
392-
| moina | parent |
391+
| moina-blog | active |
392+
| moina | parent |
393393

394394
Scenario: When updating a theme --format should be the same when using --dry-run
395395
Given a WP install

src/Theme_Command.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ class Theme_Command extends CommandWithUpgrade {
4949
protected $upgrade_refresh = 'wp_update_themes';
5050
protected $upgrade_transient = 'update_themes';
5151

52-
protected $obj_fields = [ 'name', 'status', 'update', 'version' ];
52+
protected $obj_fields = [
53+
'name',
54+
'status',
55+
'update',
56+
'version',
57+
'auto_update'
58+
];
5359

5460
public function __construct() {
5561
if ( is_multisite() ) {

0 commit comments

Comments
 (0)