Skip to content

Commit bc7c284

Browse files
committed
Merge branch 'main' of github.com:sejas/wp-cli-extension-command into add/update-version-default-field
2 parents a03a8fe + 0ddd27f commit bc7c284

11 files changed

+57
-173
lines changed

features/plugin-auto-updates-disable.feature

Lines changed: 12 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,19 @@ Feature: Disable auto-updates for WordPress plugins
3232
"""
3333
And the return code should be 0
3434

35-
@require-wp-5.5 @require-mysql
35+
@require-wp-5.5
3636
Scenario: Disable auto-updates for all plugins
37-
When I run `wp plugin auto-updates disable --all`
38-
Then STDOUT should be:
39-
"""
40-
Success: Disabled 3 of 3 plugin auto-updates.
41-
"""
42-
And the return code should be 0
37+
When I run `wp plugin list --status=inactive --format=count`
38+
Then save STDOUT as {PLUGIN_COUNT}
4339

44-
@require-wp-5.5 @require-sqlite
45-
Scenario: Disable auto-updates for all plugins
4640
When I run `wp plugin auto-updates disable --all`
4741
Then STDOUT should be:
4842
"""
49-
Success: Disabled 4 of 4 plugin auto-updates.
43+
Success: Disabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
5044
"""
5145
And the return code should be 0
5246

53-
@require-wp-5.5 @require-mysql
47+
@require-wp-5.5
5448
Scenario: Disable auto-updates for already disabled plugins
5549
When I run `wp plugin auto-updates disable hello`
5650
And I try `wp plugin auto-updates disable --all`
@@ -63,41 +57,22 @@ Feature: Disable auto-updates for WordPress plugins
6357
Error: Only disabled 2 of 3 plugin auto-updates.
6458
"""
6559

66-
@require-wp-5.5 @require-sqlite
67-
Scenario: Disable auto-updates for already disabled plugins
60+
@require-wp-5.5
61+
Scenario: Filter when disabling auto-updates for already enabled plugins
6862
When I run `wp plugin auto-updates disable hello`
69-
And I try `wp plugin auto-updates disable --all`
70-
Then STDERR should contain:
71-
"""
72-
Warning: Auto-updates already disabled for plugin hello.
73-
"""
74-
And STDERR should contain:
75-
"""
76-
Error: Only disabled 3 of 4 plugin auto-updates.
77-
"""
7863

79-
@require-wp-5.5 @require-mysql
80-
Scenario: Filter when enabling auto-updates for already disabled plugins
81-
When I run `wp plugin auto-updates disable hello`
82-
And I run `wp plugin auto-updates disable --all --enabled-only`
83-
Then STDOUT should be:
84-
"""
85-
Success: Disabled 2 of 2 plugin auto-updates.
86-
"""
87-
And the return code should be 0
64+
When I run `wp plugin list --auto_update=on --format=count`
65+
Then save STDOUT as {PLUGIN_COUNT}
8866

89-
@require-wp-5.5 @require-sqlite
90-
Scenario: Filter when enabling auto-updates for already disabled plugins
91-
When I run `wp plugin auto-updates disable hello`
92-
And I run `wp plugin auto-updates disable --all --enabled-only`
67+
When I run `wp plugin auto-updates disable --all --enabled-only`
9368
Then STDOUT should be:
9469
"""
95-
Success: Disabled 3 of 3 plugin auto-updates.
70+
Success: Disabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
9671
"""
9772
And the return code should be 0
9873

9974
@require-wp-5.5
100-
Scenario: Filter when enabling auto-updates for already disabled selection of plugins
75+
Scenario: Filter when disabling auto-updates for already disabled selection of plugins
10176
When I run `wp plugin auto-updates disable hello`
10277
And I run `wp plugin auto-updates disable hello duplicate-post --enabled-only`
10378
Then STDOUT should be:

features/plugin-auto-updates-enable.feature

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,19 @@ Feature: Enable auto-updates for WordPress plugins
3131
"""
3232
And the return code should be 0
3333

34-
@require-wp-5.5 @require-mysql
34+
@require-wp-5.5
3535
Scenario: Enable auto-updates for all plugins
36-
When I run `wp plugin auto-updates enable --all`
37-
Then STDOUT should be:
38-
"""
39-
Success: Enabled 3 of 3 plugin auto-updates.
40-
"""
41-
And the return code should be 0
36+
When I run `wp plugin list --status=inactive --format=count`
37+
Then save STDOUT as {PLUGIN_COUNT}
4238

43-
@require-wp-5.5 @require-sqlite
44-
Scenario: Enable auto-updates for all plugins
4539
When I run `wp plugin auto-updates enable --all`
4640
Then STDOUT should be:
4741
"""
48-
Success: Enabled 4 of 4 plugin auto-updates.
42+
Success: Enabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
4943
"""
5044
And the return code should be 0
5145

52-
@require-wp-5.5 @require-mysql
46+
@require-wp-5.5
5347
Scenario: Enable auto-updates for already enabled plugins
5448
When I run `wp plugin auto-updates enable hello`
5549
And I try `wp plugin auto-updates enable --all`
@@ -62,36 +56,16 @@ Feature: Enable auto-updates for WordPress plugins
6256
Error: Only enabled 2 of 3 plugin auto-updates.
6357
"""
6458

65-
@require-wp-5.5 @require-sqlite
66-
Scenario: Enable auto-updates for already enabled plugins
67-
When I run `wp plugin auto-updates enable hello`
68-
And I try `wp plugin auto-updates enable --all`
69-
Then STDERR should contain:
70-
"""
71-
Warning: Auto-updates already enabled for plugin hello.
72-
"""
73-
And STDERR should contain:
74-
"""
75-
Error: Only enabled 3 of 4 plugin auto-updates.
76-
"""
77-
78-
@require-wp-5.5 @require-mysql
59+
@require-wp-5.5
7960
Scenario: Filter when enabling auto-updates for already enabled plugins
8061
When I run `wp plugin auto-updates enable hello`
81-
And I run `wp plugin auto-updates enable --all --disabled-only`
82-
Then STDOUT should be:
83-
"""
84-
Success: Enabled 2 of 2 plugin auto-updates.
85-
"""
86-
And the return code should be 0
62+
And I run `wp plugin list --status=inactive --auto_update=off --format=count`
63+
Then save STDOUT as {PLUGIN_COUNT}
8764

88-
@require-wp-5.5 @require-sqlite
89-
Scenario: Filter when enabling auto-updates for already enabled plugins
90-
When I run `wp plugin auto-updates enable hello`
91-
And I run `wp plugin auto-updates enable --all --disabled-only`
65+
When I run `wp plugin auto-updates enable --all --disabled-only`
9266
Then STDOUT should be:
9367
"""
94-
Success: Enabled 3 of 3 plugin auto-updates.
68+
Success: Enabled {PLUGIN_COUNT} of {PLUGIN_COUNT} plugin auto-updates.
9569
"""
9670
And the return code should be 0
9771

features/plugin-auto-updates-status.feature

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -81,32 +81,14 @@ Feature: Show the status of auto-updates for WordPress plugins
8181
Error: --enabled-only and --disabled-only are mutually exclusive and cannot be used at the same time.
8282
"""
8383

84-
@require-wp-5.5 @require-mysql
85-
Scenario: The fields can be shown individually
86-
Given I run `wp plugin auto-updates enable hello`
87-
88-
When I run `wp plugin auto-updates status --all --disabled-only --field=name`
89-
Then STDOUT should be:
90-
"""
91-
akismet
92-
duplicate-post
93-
"""
94-
95-
When I run `wp plugin auto-updates status hello --field=status`
96-
Then STDOUT should be:
97-
"""
98-
enabled
99-
"""
100-
101-
@require-wp-5.5 @require-sqlite
84+
@require-wp-5.5
10285
Scenario: The fields can be shown individually
10386
Given I run `wp plugin auto-updates enable hello`
10487

10588
When I run `wp plugin auto-updates status --all --disabled-only --field=name`
10689
Then STDOUT should be:
10790
"""
10891
akismet
109-
sqlite-database-integration
11092
duplicate-post
11193
"""
11294

@@ -116,7 +98,7 @@ Feature: Show the status of auto-updates for WordPress plugins
11698
enabled
11799
"""
118100

119-
@require-wp-5.5 @require-mysql
101+
@require-wp-5.5
120102
Scenario: Formatting options work
121103
When I run `wp plugin auto-updates status --all --format=json`
122104
Then STDOUT should be:
@@ -132,21 +114,3 @@ Feature: Show the status of auto-updates for WordPress plugins
132114
hello,disabled
133115
duplicate-post,disabled
134116
"""
135-
136-
@require-wp-5.5 @require-sqlite
137-
Scenario: Formatting options work
138-
When I run `wp plugin auto-updates status --all --format=json`
139-
Then STDOUT should be:
140-
"""
141-
[{"name":"akismet","status":"disabled"},{"name":"hello","status":"disabled"},{"name":"sqlite-database-integration","status":"disabled"},{"name":"duplicate-post","status":"disabled"}]
142-
"""
143-
144-
When I run `wp plugin auto-updates status --all --format=csv`
145-
Then STDOUT should be:
146-
"""
147-
name,status
148-
akismet,disabled
149-
hello,disabled
150-
sqlite-database-integration,disabled
151-
duplicate-post,disabled
152-
"""

features/plugin-delete.feature

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ Feature: Delete WordPress plugins
1212
"""
1313
And the return code should be 0
1414

15-
@require-mysql
1615
Scenario: Delete all installed plugins
1716
When I run `wp plugin delete --all`
1817
Then STDOUT should be:
@@ -29,24 +28,6 @@ Feature: Delete WordPress plugins
2928
Success: No plugins deleted.
3029
"""
3130

32-
@require-sqlite
33-
Scenario: Delete all installed plugins
34-
When I run `wp plugin delete --all`
35-
Then STDOUT should be:
36-
"""
37-
Deleted 'akismet' plugin.
38-
Deleted 'hello' plugin.
39-
Deleted 'sqlite-database-integration' plugin.
40-
Success: Deleted 3 of 3 plugins.
41-
"""
42-
And the return code should be 0
43-
44-
When I run the previous command again
45-
Then STDOUT should be:
46-
"""
47-
Success: No plugins deleted.
48-
"""
49-
5031
Scenario: Attempting to delete a plugin that doesn't exist
5132
When I try `wp plugin delete edit-flow`
5233
Then STDOUT should be:
@@ -59,7 +40,6 @@ Feature: Delete WordPress plugins
5940
"""
6041
And the return code should be 0
6142

62-
@require-mysql
6343
Scenario: Excluding a plugin from deletion when using --all switch
6444
When I try `wp plugin delete --all --exclude=akismet,hello`
6545
Then STDOUT should be:
@@ -68,15 +48,6 @@ Feature: Delete WordPress plugins
6848
"""
6949
And the return code should be 0
7050

71-
@require-sqlite
72-
Scenario: Excluding a plugin from deletion when using --all switch
73-
When I try `wp plugin delete --all --exclude=akismet,hello,sqlite-database-integration`
74-
Then STDOUT should be:
75-
"""
76-
Success: No plugins deleted.
77-
"""
78-
And the return code should be 0
79-
8051
Scenario: Excluding a missing plugin should not throw an error
8152
Given a WP install
8253
And I run `wp plugin delete --all --exclude=missing-plugin`

features/plugin-uninstall.feature

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ Feature: Uninstall a WordPress plugin
7272
Success: Uninstalled 2 of 2 plugins.
7373
"""
7474

75-
@require-mysql
7675
Scenario: Excluding a plugin from uninstallation when using --all switch
7776
When I try `wp plugin uninstall --all --exclude=akismet,hello`
7877
Then STDOUT should be:
@@ -81,15 +80,6 @@ Feature: Uninstall a WordPress plugin
8180
"""
8281
And the return code should be 0
8382

84-
@require-sqlite
85-
Scenario: Excluding a plugin from uninstallation when using --all switch
86-
When I try `wp plugin uninstall --all --exclude=akismet,hello,sqlite-database-integration`
87-
Then STDOUT should be:
88-
"""
89-
Success: No plugins uninstalled.
90-
"""
91-
And the return code should be 0
92-
9383
Scenario: Excluding a missing plugin should not throw an error
9484
Given a WP install
9585
And I run `wp plugin uninstall --all --exclude=missing-plugin`

features/plugin-update.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Feature: Update WordPress plugins
1313

1414
When I run `wp plugin list`
1515
Then STDOUT should be a table containing rows:
16-
| name | status | update | version | update_version |
17-
| wordpress-importer | inactive | available | 0.5 | {UPDATE_VERSION} |
16+
| name | status | update | version | update_version | auto_update |
17+
| wordpress-importer | inactive | available | 0.5 | {UPDATE_VERSION} | off |
1818

1919
When I try `wp plugin update akismet --version=0.5.3`
2020
Then STDERR should be:
@@ -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 | update_version |
29-
| wordpress-importer | inactive | available | 0.5 | {UPDATE_VERSION} |
28+
| name | status | update | version | update_version | auto_update |
29+
| wordpress-importer | inactive | available | 0.5 | {UPDATE_VERSION} | 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 | update_version |
37-
| wordpress-importer | inactive | none | {UPDATE_VERSION} | |
36+
| name | status | update | version | 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: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Feature: Manage WordPress plugins
6363

6464
When I run `wp plugin list`
6565
Then STDOUT should be a table containing rows:
66-
| name | status | update | version | update_version |
67-
| Zombieland | active | none | 0.1.0 | |
66+
| name | status | update | version | update_version | auto_update |
67+
| Zombieland | active | none | 0.1.0 | | off |
6868

6969
When I try `wp plugin uninstall Zombieland`
7070
Then STDERR should be:
@@ -131,8 +131,8 @@ Feature: Manage WordPress plugins
131131

132132
When I run `wp plugin list`
133133
Then STDOUT should be a table containing rows:
134-
| name | status | update | version | update_version |
135-
| wordpress-importer | active | available | 0.5 | {UPDATE_VERSION} |
134+
| name | status | update | version | update_version | auto_update |
135+
| wordpress-importer | active | available | 0.5 | {UPDATE_VERSION} | off |
136136

137137
When I try `wp plugin update`
138138
Then STDERR should be:
@@ -397,11 +397,13 @@ Feature: Manage WordPress plugins
397397
Installing Debug Bar List Script & Style Dependencies
398398
"""
399399

400+
# Not running for SQLite because it involves another must-use plugin and a drop-in.
401+
@require-mysql
400402
Scenario: Enable and disable all plugins
401403
Given a WP install
402404

403405
When I run `wp plugin activate --all`
404-
Then STDOUT should be:
406+
Then STDOUT should contain:
405407
"""
406408
Plugin 'akismet' activated.
407409
Plugin 'hello' activated.
@@ -654,8 +656,8 @@ Feature: Manage WordPress plugins
654656

655657
When I run `wp plugin list`
656658
Then STDOUT should be a table containing rows:
657-
| name | status | update | version | update_version |
658-
| hello-dolly | inactive | version higher than expected | {PLUGIN_VERSION} | {UPDATE_VERSION} |
659+
| name | status | update | version | update_version | auto_update |
660+
| hello-dolly | inactive | version higher than expected | {PLUGIN_VERSION} | {UPDATE_VERSION} | off |
659661

660662
When I try `wp plugin update --all`
661663
Then STDERR should be:

0 commit comments

Comments
 (0)