Skip to content

Commit 25a4276

Browse files
committed
Update tests for Hello Dolly
1 parent fa25c55 commit 25a4276

8 files changed

+75
-65
lines changed

features/plugin-activate.feature

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,20 @@ Feature: Activate WordPress plugins
2121
"""
2222
And the return code should be 1
2323

24-
When I try `wp plugin activate akismet hello debug-bar`
24+
When I try `wp plugin activate akismet debug-bar`
2525
Then STDERR should be:
2626
"""
2727
Warning: The 'debug-bar' plugin could not be found.
28-
Error: Only activated 2 of 3 plugins.
28+
Error: Only activated 1 of 2 plugins.
2929
"""
3030
And STDOUT should be:
3131
"""
3232
Plugin 'akismet' activated.
33-
Plugin 'hello' activated.
3433
"""
3534
And the return code should be 1
3635

3736
Scenario: Activate all when one plugin is hidden by "all_plugins" filter
38-
Given I run `wp plugin install site-secrets`
37+
Given I run `wp plugin install site-secrets https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
3938
And a wp-content/mu-plugins/hide-us-plugin.php file:
4039
"""
4140
<?php
@@ -55,7 +54,7 @@ Feature: Activate WordPress plugins
5554
Then STDOUT should contain:
5655
"""
5756
Plugin 'akismet' activated.
58-
Plugin 'hello' activated.
57+
Plugin 'sample-plugin' activated.
5958
"""
6059
And STDOUT should not contain:
6160
"""
@@ -135,7 +134,7 @@ Feature: Activate WordPress plugins
135134
"""
136135

137136
Scenario: Adding --exclude with plugin activate --all should exclude the plugins specified via --exclude
138-
When I try `wp plugin activate --all --exclude=hello`
137+
When I try `wp plugin activate --all --exclude=hello,hello-dolly`
139138
Then STDOUT should be:
140139
"""
141140
Plugin 'akismet' activated.

features/plugin-auto-updates-disable.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Feature: Disable auto-updates for WordPress plugins
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin install duplicate-post --ignore-requirements`
5+
And I run `wp plugin install duplicate-post https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip --ignore-requirements`
66
And I run `wp plugin auto-updates enable --all`
77

88
@require-wp-5.5
@@ -16,7 +16,7 @@ Feature: Disable auto-updates for WordPress plugins
1616

1717
@require-wp-5.5
1818
Scenario: Disable auto-updates for a single plugin
19-
When I run `wp plugin auto-updates disable hello`
19+
When I run `wp plugin auto-updates disable sample-plugin`
2020
Then STDOUT should be:
2121
"""
2222
Success: Disabled 1 of 1 plugin auto-updates.
@@ -25,7 +25,7 @@ Feature: Disable auto-updates for WordPress plugins
2525

2626
@require-wp-5.5
2727
Scenario: Disable auto-updates for multiple plugins
28-
When I run `wp plugin auto-updates disable hello duplicate-post`
28+
When I run `wp plugin auto-updates disable sample-plugin duplicate-post`
2929
Then STDOUT should be:
3030
"""
3131
Success: Disabled 2 of 2 plugin auto-updates.
@@ -46,11 +46,11 @@ Feature: Disable auto-updates for WordPress plugins
4646

4747
@require-wp-5.5
4848
Scenario: Disable auto-updates for already disabled plugins
49-
When I run `wp plugin auto-updates disable hello`
49+
When I run `wp plugin auto-updates disable sample-plugin`
5050
And I try `wp plugin auto-updates disable --all`
5151
Then STDERR should contain:
5252
"""
53-
Warning: Auto-updates already disabled for plugin hello.
53+
Warning: Auto-updates already disabled for plugin sample-plugin.
5454
"""
5555
And STDERR should contain:
5656
"""
@@ -59,7 +59,7 @@ Feature: Disable auto-updates for WordPress plugins
5959

6060
@require-wp-5.5
6161
Scenario: Filter when disabling auto-updates for already enabled plugins
62-
When I run `wp plugin auto-updates disable hello`
62+
When I run `wp plugin auto-updates disable sample-plugin`
6363
And I run `wp plugin list --auto_update=on --format=count`
6464
Then save STDOUT as {PLUGIN_COUNT}
6565

@@ -72,8 +72,8 @@ Feature: Disable auto-updates for WordPress plugins
7272

7373
@require-wp-5.5
7474
Scenario: Filter when disabling auto-updates for already disabled selection of plugins
75-
When I run `wp plugin auto-updates disable hello`
76-
And I run `wp plugin auto-updates disable hello duplicate-post --enabled-only`
75+
When I run `wp plugin auto-updates disable sample-plugin`
76+
And I run `wp plugin auto-updates disable sample-plugin duplicate-post --enabled-only`
7777
Then STDOUT should be:
7878
"""
7979
Success: Disabled 1 of 1 plugin auto-updates.
@@ -82,8 +82,8 @@ Feature: Disable auto-updates for WordPress plugins
8282

8383
@require-wp-5.5
8484
Scenario: Filtering everything away produces an error
85-
When I run `wp plugin auto-updates disable hello`
86-
And I try `wp plugin auto-updates disable hello --enabled-only`
85+
When I run `wp plugin auto-updates disable sample-plugin`
86+
And I try `wp plugin auto-updates disable sample-plugin --enabled-only`
8787
Then STDERR should be:
8888
"""
8989
Error: No plugins provided to disable auto-updates for.

features/plugin-auto-updates-enable.feature

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Feature: Enable auto-updates for WordPress plugins
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin install duplicate-post --ignore-requirements`
5+
And I run `wp plugin install duplicate-post https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip --ignore-requirements`
66

77
@require-wp-5.5
88
Scenario: Show an error if required params are missing
@@ -15,7 +15,7 @@ Feature: Enable auto-updates for WordPress plugins
1515

1616
@require-wp-5.5
1717
Scenario: Enable auto-updates for a single plugin
18-
When I run `wp plugin auto-updates enable hello`
18+
When I run `wp plugin auto-updates enable sample-plugin`
1919
Then STDOUT should be:
2020
"""
2121
Success: Enabled 1 of 1 plugin auto-updates.
@@ -24,7 +24,7 @@ Feature: Enable auto-updates for WordPress plugins
2424

2525
@require-wp-5.5
2626
Scenario: Enable auto-updates for multiple plugins
27-
When I run `wp plugin auto-updates enable hello duplicate-post`
27+
When I run `wp plugin auto-updates enable sample-plugin duplicate-post`
2828
Then STDOUT should be:
2929
"""
3030
Success: Enabled 2 of 2 plugin auto-updates.
@@ -45,11 +45,11 @@ Feature: Enable auto-updates for WordPress plugins
4545

4646
@require-wp-5.5
4747
Scenario: Enable auto-updates for already enabled plugins
48-
When I run `wp plugin auto-updates enable hello`
48+
When I run `wp plugin auto-updates enable sample-plugin`
4949
And I try `wp plugin auto-updates enable --all`
5050
Then STDERR should contain:
5151
"""
52-
Warning: Auto-updates already enabled for plugin hello.
52+
Warning: Auto-updates already enabled for plugin sample-plugin.
5353
"""
5454
And STDERR should contain:
5555
"""
@@ -58,7 +58,7 @@ Feature: Enable auto-updates for WordPress plugins
5858

5959
@require-wp-5.5
6060
Scenario: Filter when enabling auto-updates for already enabled plugins
61-
When I run `wp plugin auto-updates enable hello`
61+
When I run `wp plugin auto-updates enable sample-plugin`
6262
And I run `wp plugin list --status=inactive --auto_update=off --format=count`
6363
Then save STDOUT as {PLUGIN_COUNT}
6464

@@ -71,8 +71,8 @@ Feature: Enable auto-updates for WordPress plugins
7171

7272
@require-wp-5.5
7373
Scenario: Filter when enabling auto-updates for already enabled selection of plugins
74-
When I run `wp plugin auto-updates enable hello`
75-
And I run `wp plugin auto-updates enable hello duplicate-post --disabled-only`
74+
When I run `wp plugin auto-updates enable sample-plugin`
75+
And I run `wp plugin auto-updates enable sample-plugin duplicate-post --disabled-only`
7676
Then STDOUT should be:
7777
"""
7878
Success: Enabled 1 of 1 plugin auto-updates.
@@ -81,8 +81,8 @@ Feature: Enable auto-updates for WordPress plugins
8181

8282
@require-wp-5.5
8383
Scenario: Filtering everything away produces an error
84-
When I run `wp plugin auto-updates enable hello`
85-
And I try `wp plugin auto-updates enable hello --disabled-only`
84+
When I run `wp plugin auto-updates enable sample-plugin`
85+
And I try `wp plugin auto-updates enable sample-plugin --disabled-only`
8686
Then STDERR should be:
8787
"""
8888
Error: No plugins provided to enable auto-updates for.

features/plugin-auto-updates-status.feature

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Feature: Show the status of auto-updates for WordPress plugins
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin install duplicate-post --ignore-requirements`
5+
And I run `wp plugin install duplicate-post https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip --ignore-requirements`
66

77
@require-wp-5.5
88
Scenario: Show an error if required params are missing
@@ -15,19 +15,19 @@ Feature: Show the status of auto-updates for WordPress plugins
1515

1616
@require-wp-5.5
1717
Scenario: Show the status of auto-updates of a single plugin
18-
When I run `wp plugin auto-updates status hello`
18+
When I run `wp plugin auto-updates status sample-plugin`
1919
Then STDOUT should be a table containing rows:
2020
| name | status |
21-
| hello | disabled |
21+
| sample-plugin | disabled |
2222
And the return code should be 0
2323

2424
@require-wp-5.5
2525
Scenario: Show the status of auto-updates multiple plugins
26-
When I run `wp plugin auto-updates status duplicate-post hello`
26+
When I run `wp plugin auto-updates status duplicate-post sample-plugin`
2727
Then STDOUT should be a table containing rows:
2828
| name | status |
2929
| duplicate-post | disabled |
30-
| hello | disabled |
30+
| sample-plugin | disabled |
3131
And the return code should be 0
3232

3333
@require-wp-5.5
@@ -37,7 +37,7 @@ Feature: Show the status of auto-updates for WordPress plugins
3737
| name | status |
3838
| akismet | disabled |
3939
| duplicate-post | disabled |
40-
| hello | disabled |
40+
| sample-plugin | disabled |
4141
And the return code should be 0
4242

4343
When I run `wp plugin auto-updates enable --all`
@@ -46,25 +46,25 @@ Feature: Show the status of auto-updates for WordPress plugins
4646
| name | status |
4747
| akismet | enabled |
4848
| duplicate-post | enabled |
49-
| hello | enabled |
49+
| sample-plugin | enabled |
5050
And the return code should be 0
5151

5252
@require-wp-5.5
5353
Scenario: The status can be filtered to only show enabled or disabled plugins
54-
Given I run `wp plugin auto-updates enable hello`
54+
Given I run `wp plugin auto-updates enable sample-plugin`
5555

5656
When I run `wp plugin auto-updates status --all`
5757
Then STDOUT should be a table containing rows:
5858
| name | status |
5959
| akismet | disabled |
6060
| duplicate-post | disabled |
61-
| hello | enabled |
61+
| sample-plugin | enabled |
6262
And the return code should be 0
6363

6464
When I run `wp plugin auto-updates status --all --enabled-only`
6565
Then STDOUT should be a table containing rows:
6666
| name | status |
67-
| hello | enabled |
67+
| sample-plugin | enabled |
6868
And the return code should be 0
6969

7070
When I run `wp plugin auto-updates status --all --disabled-only`
@@ -83,7 +83,7 @@ Feature: Show the status of auto-updates for WordPress plugins
8383

8484
@require-wp-5.5
8585
Scenario: The fields can be shown individually
86-
Given I run `wp plugin auto-updates enable hello`
86+
Given I run `wp plugin auto-updates enable sample-plugin`
8787

8888
When I run `wp plugin auto-updates status --all --disabled-only --field=name`
8989
Then STDOUT should be:
@@ -92,7 +92,7 @@ Feature: Show the status of auto-updates for WordPress plugins
9292
duplicate-post
9393
"""
9494

95-
When I run `wp plugin auto-updates status hello --field=status`
95+
When I run `wp plugin auto-updates status sample-plugin --field=status`
9696
Then STDOUT should be:
9797
"""
9898
enabled
@@ -103,21 +103,21 @@ Feature: Show the status of auto-updates for WordPress plugins
103103
When I run `wp plugin auto-updates status --all --format=json`
104104
Then STDOUT should be:
105105
"""
106-
[{"name":"akismet","status":"disabled"},{"name":"hello","status":"disabled"},{"name":"duplicate-post","status":"disabled"}]
106+
[{"name":"akismet","status":"disabled"},{"name":"sample-plugin","status":"disabled"},{"name":"duplicate-post","status":"disabled"}]
107107
"""
108108

109109
When I run `wp plugin auto-updates status --all --format=csv`
110110
Then STDOUT should be:
111111
"""
112112
name,status
113113
akismet,disabled
114-
hello,disabled
114+
sample-plugin,disabled
115115
duplicate-post,disabled
116116
"""
117117

118118
@require-wp-5.5
119119
Scenario: Handle malformed option value
120120
When I run `wp option update auto_update_plugins ""`
121-
And I try `wp plugin auto-updates status hello`
121+
And I try `wp plugin auto-updates status sample-plugin`
122122
Then the return code should be 0
123123
And STDERR should be empty

features/plugin-deactivate.feature

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ Feature: Deactivate WordPress plugins
22

33
Background:
44
Given a WP install
5-
And I run `wp plugin activate akismet hello`
5+
And I run `wp plugin install https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
6+
And I run `wp plugin activate akismet sample-plugin`
67

78
Scenario: Deactivate a plugin that's already activated
89
When I run `wp plugin deactivate akismet`
@@ -23,7 +24,7 @@ Feature: Deactivate WordPress plugins
2324
And STDOUT should be empty
2425
And the return code should be 1
2526

26-
When I try `wp plugin deactivate akismet hello debug-bar`
27+
When I try `wp plugin deactivate akismet sample-plugin debug-bar`
2728
Then STDERR should be:
2829
"""
2930
Warning: The 'debug-bar' plugin could not be found.
@@ -32,7 +33,7 @@ Feature: Deactivate WordPress plugins
3233
And STDOUT should be:
3334
"""
3435
Plugin 'akismet' deactivated.
35-
Plugin 'hello' deactivated.
36+
Plugin 'sample-plugin' deactivated.
3637
"""
3738
And the return code should be 1
3839

@@ -78,7 +79,7 @@ Feature: Deactivate WordPress plugins
7879
"""
7980

8081
Scenario: Adding --exclude with plugin deactivate --all should exclude the plugins specified via --exclude
81-
When I try `wp plugin deactivate --all --exclude=hello`
82+
When I try `wp plugin deactivate --all --exclude=sample-plugin`
8283
Then STDOUT should be:
8384
"""
8485
Plugin 'akismet' deactivated.
@@ -87,7 +88,7 @@ Feature: Deactivate WordPress plugins
8788
And the return code should be 0
8889

8990
Scenario: Adding --exclude with plugin deactivate should throw an error unless --all given
90-
When I try `wp plugin deactivate --exclude=hello`
91+
When I try `wp plugin deactivate --exclude=sample-plugin`
9192
Then the return code should be 1
9293
And STDERR should be:
9394
"""

features/plugin-delete.feature

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Feature: Delete WordPress plugins
22

33
Background:
44
Given a WP install
5+
And I run `wp plugin install https://github.com/wp-cli/sample-plugin/archive/refs/heads/master.zip`
56

67
Scenario: Delete an installed plugin
78
When I run `wp plugin delete akismet`
@@ -17,7 +18,7 @@ Feature: Delete WordPress plugins
1718
Then STDOUT should be:
1819
"""
1920
Deleted 'akismet' plugin.
20-
Deleted 'hello' plugin.
21+
Deleted 'sample-plugin' plugin.
2122
Success: Deleted 2 of 2 plugins.
2223
"""
2324
And the return code should be 0
@@ -41,7 +42,7 @@ Feature: Delete WordPress plugins
4142
And the return code should be 0
4243

4344
Scenario: Excluding a plugin from deletion when using --all switch
44-
When I try `wp plugin delete --all --exclude=akismet,hello`
45+
When I try `wp plugin delete --all --exclude=akismet,sample-plugin`
4546
Then STDOUT should be:
4647
"""
4748
Success: No plugins deleted.

0 commit comments

Comments
 (0)