Skip to content

Commit 43135fb

Browse files
schlesseraclaude
andcommitted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 5c33ca0 commit 43135fb

14 files changed

Lines changed: 125 additions & 81 deletions

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"wp-cli/extension-command": "^1.2 || ^2 || ^3",
2121
"wp-cli/media-command": "^1.1 || ^2 || ^3",
2222
"wp-cli/super-admin-command": "^1 || ^2 || ^3",
23-
"wp-cli/wp-cli-tests": "^5"
23+
"wp-cli/wp-cli-tests": "dev-setup-commands-step as 5.3.99"
2424
},
2525
"config": {
2626
"process-timeout": 7200,

‎features/comment-recount.feature‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ Feature: Recount comments on a post
33
Scenario: Recount comments on a post
44
Given a WP install
55

6-
When I run `wp comment create --comment_post_ID=1 --comment_approved=1 --porcelain`
7-
And I run `wp comment create --comment_post_ID=1 --comment_approved=1 --porcelain`
8-
And I run `wp post get 1 --field=comment_count`
6+
Given these setup commands:
7+
| command |
8+
| wp comment create --comment_post_ID=1 --comment_approved=1 --porcelain |
9+
| wp comment create --comment_post_ID=1 --comment_approved=1 --porcelain |
10+
When I run `wp post get 1 --field=comment_count`
911
Then STDOUT should be:
1012
"""
1113
3

‎features/comment.feature‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ Feature: Manage WordPress comments
4848
"""
4949
And the return code should be 1
5050

51-
When I run `wp comment create --comment_post_ID=1`
52-
And I run `wp comment create --comment_post_ID=1`
53-
And I run `wp comment delete 3 4`
51+
Given these setup commands:
52+
| command |
53+
| wp comment create --comment_post_ID=1 |
54+
| wp comment create --comment_post_ID=1 |
55+
When I run `wp comment delete 3 4`
5456
Then STDOUT should be:
5557
"""
5658
Success: Trashed comment 3.

‎features/menu-location.feature‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ Feature: Manage WordPress menu locations
1111
| location | description |
1212
| primary | Primary Menu |
1313

14-
When I run `wp menu create "Primary Menu"`
15-
And I run `wp menu location assign primary-menu primary`
16-
And I run `wp menu list --fields=slug,locations`
14+
Given these setup commands:
15+
| command |
16+
| wp menu create "Primary Menu" |
17+
| wp menu location assign primary-menu primary |
18+
When I run `wp menu list --fields=slug,locations`
1719
Then STDOUT should be a table containing rows:
1820
| slug | locations |
1921
| primary-menu | primary |

‎features/menu.feature‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ Feature: Manage WordPress menus
2525
0
2626
"""
2727

28-
When I run `wp menu create "First Menu"`
29-
And I run `wp menu create "Second Menu"`
30-
And I run `wp menu list --fields=name,slug`
28+
Given these setup commands:
29+
| command |
30+
| wp menu create "First Menu" |
31+
| wp menu create "Second Menu" |
32+
When I run `wp menu list --fields=name,slug`
3133
Then STDOUT should be a table containing rows:
3234
| name | slug |
3335
| First Menu | first-menu |

‎features/option-list.feature‎

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ Feature: List WordPress options
3636
@skip-object-cache
3737
Scenario: Using the `--autoload=on` flag excludes transients by default
3838
Given a WP install
39-
And I run `wp option add sample_autoload_option 'sample_autoload_option' --autoload=yes`
40-
And I run `wp transient set sample_autoload_transient 'sample_autoload_transient'`
39+
And these setup commands:
40+
| command |
41+
| wp option add sample_autoload_option 'sample_autoload_option' --autoload=yes |
42+
| wp transient set sample_autoload_transient 'sample_autoload_transient' |
4143

4244
When I run `wp option list --autoload=on`
4345
Then STDOUT should contain:
@@ -62,9 +64,11 @@ Feature: List WordPress options
6264
Scenario: List option with exclude pattern
6365
Given a WP install
6466

65-
When I run `wp option add sample_test_field_one sample_test_field_value_one`
66-
And I run `wp option add sample_test_field_two sample_test_field_value_two`
67-
And I run `wp option list --search="sample_test_field_*" --format=csv`
67+
Given these setup commands:
68+
| command |
69+
| wp option add sample_test_field_one sample_test_field_value_one |
70+
| wp option add sample_test_field_two sample_test_field_value_two |
71+
When I run `wp option list --search="sample_test_field_*" --format=csv`
6872
Then STDOUT should be:
6973
"""
7074
option_name,option_value
@@ -93,8 +97,10 @@ Feature: List WordPress options
9397

9498
Scenario: List option with sorting option
9599
Given a WP install
96-
And I run `wp option add sample_test_field_one sample_test_field_value_one`
97-
And I run `wp option add sample_test_field_two sample_test_field_value_two`
100+
And these setup commands:
101+
| command |
102+
| wp option add sample_test_field_one sample_test_field_value_one |
103+
| wp option add sample_test_field_two sample_test_field_value_two |
98104

99105
When I run `wp option list --search="sample_test_field_*" --format=csv --orderby=option_id --order=asc`
100106
Then STDOUT should be:
@@ -178,10 +184,12 @@ Feature: List WordPress options
178184

179185
Scenario: Using the `--autoload=on` flag
180186
Given a WP install
181-
And I run `wp option add sample_autoload_one 'sample_value_one' --autoload=yes`
182-
And I run `wp option add sample_autoload_two 'sample_value_two' --autoload=no`
183-
And I run `wp option add sample_autoload_three 'sample_value_three' --autoload=on`
184-
And I run `wp option add sample_autoload_four 'sample_value_four' --autoload=off`
187+
And these setup commands:
188+
| command |
189+
| wp option add sample_autoload_one 'sample_value_one' --autoload=yes |
190+
| wp option add sample_autoload_two 'sample_value_two' --autoload=no |
191+
| wp option add sample_autoload_three 'sample_value_three' --autoload=on |
192+
| wp option add sample_autoload_four 'sample_value_four' --autoload=off |
185193

186194
When I run `wp option list --autoload=on`
187195
Then STDOUT should not contain:
@@ -203,10 +211,12 @@ Feature: List WordPress options
203211

204212
Scenario: Using the `--autoload=off` flag
205213
Given a WP install
206-
And I run `wp option add sample_autoload_one 'sample_value_one' --autoload=yes`
207-
And I run `wp option add sample_autoload_two 'sample_value_two' --autoload=no`
208-
And I run `wp option add sample_autoload_three 'sample_value_three' --autoload=on`
209-
And I run `wp option add sample_autoload_four 'sample_value_four' --autoload=off`
214+
And these setup commands:
215+
| command |
216+
| wp option add sample_autoload_one 'sample_value_one' --autoload=yes |
217+
| wp option add sample_autoload_two 'sample_value_two' --autoload=no |
218+
| wp option add sample_autoload_three 'sample_value_three' --autoload=on |
219+
| wp option add sample_autoload_four 'sample_value_four' --autoload=off |
210220

211221
When I run `wp option list --autoload=off`
212222
Then STDOUT should not contain:

‎features/post.feature‎

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -394,9 +394,11 @@ Feature: Manage WordPress posts
394394
| Sample Page | sample-page | publish |
395395

396396
Scenario: List posts with date query
397-
When I run `wp post create --post_title='old post' --post_date='2023-01-24T09:52:00.000Z'`
398-
And I run `wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z'`
399-
And I run `wp post list --field=post_title --date_query='{"before":{"year":"2024"}}'`
397+
Given these setup commands:
398+
| command |
399+
| wp post create --post_title='old post' --post_date='2023-01-24T09:52:00.000Z' |
400+
| wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z' |
401+
When I run `wp post list --field=post_title --date_query='{"before":{"year":"2024"}}'`
400402
Then STDOUT should contain:
401403
"""
402404
old post
@@ -407,12 +409,14 @@ Feature: Manage WordPress posts
407409
"""
408410

409411
Scenario: List posts with tax query
410-
When I run `wp term create category "First Category" --porcelain`
411-
And I run `wp term create category "Second Category" --porcelain`
412-
And I run `wp post create --post_title='post-1' --post_category="First Category"`
413-
And I run `wp post create --post_title='post-2' --post_category="Second Category"`
414-
And I run `wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z'`
415-
And I run `wp post list --field=post_title --tax_query='[{"taxonomy":"category","field":"slug","terms":"first-category"}]'`
412+
Given these setup commands:
413+
| command |
414+
| wp term create category "First Category" --porcelain |
415+
| wp term create category "Second Category" --porcelain |
416+
| wp post create --post_title='post-1' --post_category="First Category" |
417+
| wp post create --post_title='post-2' --post_category="Second Category" |
418+
| wp post create --post_title='new post' --post_date='2025-01-24T09:52:00.000Z' |
419+
When I run `wp post list --field=post_title --tax_query='[{"taxonomy":"category","field":"slug","terms":"first-category"}]'`
416420
Then STDOUT should contain:
417421
"""
418422
post-1
@@ -423,13 +427,13 @@ Feature: Manage WordPress posts
423427
"""
424428

425429
Scenario: Creating/updating posts with taxonomies
426-
When I run `wp term create category "First Category" --porcelain`
427-
And save STDOUT as {CAT_1}
428-
And I run `wp term create category "Second Category" --porcelain`
429-
And save STDOUT as {CAT_2}
430-
And I run `wp term create post_tag "Term One" --porcelain`
431-
And I run `wp term create post_tag "Term Two" --porcelain`
432-
And I run `wp post create --post_title='Test Post' --post_content='Test post content' --tax_input='{"category":[{CAT_1},{CAT_2}],"post_tag":["term-one", "term-two"]}' --porcelain`
430+
Given these setup commands:
431+
| command | save |
432+
| wp term create category "First Category" --porcelain | CAT_1 |
433+
| wp term create category "Second Category" --porcelain | CAT_2 |
434+
| wp term create post_tag "Term One" --porcelain | |
435+
| wp term create post_tag "Term Two" --porcelain | |
436+
When I run `wp post create --post_title='Test Post' --post_content='Test post content' --tax_input='{"category":[{CAT_1},{CAT_2}],"post_tag":["term-one", "term-two"]}' --porcelain`
433437
Then STDOUT should be a number
434438
And save STDOUT as {POST_ID}
435439

‎features/signup.feature‎

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ Feature: Manage signups in a multisite installation
1111

1212
Scenario: List signups
1313
Given a WP multisite install
14-
And I run `wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );"`
15-
And I run `wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );"`
14+
And these setup commands:
15+
| command |
16+
| wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );" |
17+
| wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );" |
1618

1719
When I run `wp user signup list --fields=signup_id,user_login,user_email,active --format=csv`
1820
Then STDOUT should be:
@@ -101,8 +103,10 @@ Feature: Manage signups in a multisite installation
101103

102104
Scenario: Activate multiple signups
103105
Given a WP multisite install
104-
And I run `wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );"`
105-
And I run `wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );"`
106+
And these setup commands:
107+
| command |
108+
| wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );" |
109+
| wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );" |
106110

107111
When I run `wp user signup list --active=0 --format=count`
108112
Then STDOUT should be:
@@ -147,8 +151,10 @@ Feature: Manage signups in a multisite installation
147151

148152
Scenario: Delete signups
149153
Given a WP multisite install
150-
And I run `wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );"`
151-
And I run `wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );"`
154+
And these setup commands:
155+
| command |
156+
| wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );" |
157+
| wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );" |
152158

153159
When I run `wp user signup get bobuser --field=user_email`
154160
Then STDOUT should be:
@@ -176,8 +182,10 @@ Feature: Manage signups in a multisite installation
176182

177183
Scenario: Delete all signups
178184
Given a WP multisite install
179-
And I run `wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );"`
180-
And I run `wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );"`
185+
And these setup commands:
186+
| command |
187+
| wp eval "wpmu_signup_user( 'bobuser', 'bobuser@example.com' );" |
188+
| wp eval "wpmu_signup_user( 'johnuser', 'johnuser@example.com' );" |
181189

182190
When I try `wp user signup delete`
183191
Then STDERR should be:
@@ -199,10 +207,12 @@ Feature: Manage signups in a multisite installation
199207

200208
Scenario: Expose add_to_blog, new_role, and blog_id fields and support filtering by them
201209
Given a WP multisite install
202-
And I run `wp eval "wpmu_signup_user( 'adminuser', 'adminuser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'administrator' ) );"`
203-
And I run `wp eval "wpmu_signup_user( 'editoruser', 'editoruser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'editor' ) );"`
204-
And I run `wp eval "wpmu_signup_user( 'otherbloguser', 'otherbloguser@example.com', array( 'add_to_blog' => 300, 'new_role' => 'administrator' ) );"`
205-
And I run `wp eval "wpmu_signup_user( 'plainuser', 'plainuser@example.com' );"`
210+
And these setup commands:
211+
| command |
212+
| wp eval "wpmu_signup_user( 'adminuser', 'adminuser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'administrator' ) );" |
213+
| wp eval "wpmu_signup_user( 'editoruser', 'editoruser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'editor' ) );" |
214+
| wp eval "wpmu_signup_user( 'otherbloguser', 'otherbloguser@example.com', array( 'add_to_blog' => 300, 'new_role' => 'administrator' ) );" |
215+
| wp eval "wpmu_signup_user( 'plainuser', 'plainuser@example.com' );" |
206216

207217
When I run `wp user signup list --active=0 --new_role=administrator --fields=user_login,new_role,blog_id --format=csv`
208218
Then STDOUT should be:
@@ -248,10 +258,12 @@ Feature: Manage signups in a multisite installation
248258

249259
Scenario: Filter signups by metadata with per_page pagination
250260
Given a WP multisite install
251-
And I run `wp eval "wpmu_signup_user( 'plainuser', 'plainuser@example.com' );"`
252-
And I run `wp eval "wpmu_signup_user( 'adminuser', 'adminuser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'administrator' ) );"`
253-
And I run `wp eval "wpmu_signup_user( 'editoruser', 'editoruser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'editor' ) );"`
254-
And I run `wp eval "wpmu_signup_user( 'otherbloguser', 'otherbloguser@example.com', array( 'add_to_blog' => 300, 'new_role' => 'administrator' ) );"`
261+
And these setup commands:
262+
| command |
263+
| wp eval "wpmu_signup_user( 'plainuser', 'plainuser@example.com' );" |
264+
| wp eval "wpmu_signup_user( 'adminuser', 'adminuser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'administrator' ) );" |
265+
| wp eval "wpmu_signup_user( 'editoruser', 'editoruser@example.com', array( 'add_to_blog' => 228, 'new_role' => 'editor' ) );" |
266+
| wp eval "wpmu_signup_user( 'otherbloguser', 'otherbloguser@example.com', array( 'add_to_blog' => 300, 'new_role' => 'administrator' ) );" |
255267

256268
When I run `wp user signup list --blog_id=228 --per_page=2 --fields=user_login,blog_id --format=csv`
257269
Then STDOUT should be:

‎features/user-application-password.feature‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,13 @@ Feature: Manage user custom fields
8888
When I try `wp user application-password get 1 {UUID}`
8989
Then the return code should be 1
9090

91-
When I run `wp user application-password create 1 myapp1`
92-
And I run `wp user application-password create 1 myapp2`
93-
And I run `wp user application-password create 1 myapp3`
94-
And I run `wp user application-password create 1 myapp4`
95-
And I run `wp user application-password create 1 myapp5`
91+
Given these setup commands:
92+
| command |
93+
| wp user application-password create 1 myapp1 |
94+
| wp user application-password create 1 myapp2 |
95+
| wp user application-password create 1 myapp3 |
96+
| wp user application-password create 1 myapp4 |
97+
When I run `wp user application-password create 1 myapp5`
9698
Then STDOUT should not be empty
9799

98100
When I run `wp user application-password list 1 --format=count`

‎features/user-import-csv.feature‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ Feature: Import users from CSV
108108
Given a WP install
109109

110110
When I run `wp user delete 1 --yes`
111-
And I run `wp user create bobjones bobjones@example.com --display_name="Bob Jones" --role=contributor`
112-
And I run `wp user create billjones billjones@example.com --display_name="Bill Jones" --role=administrator`
111+
And these setup commands:
112+
| command |
113+
| wp user create bobjones bobjones@example.com --display_name="Bob Jones" --role=contributor |
114+
| wp user create billjones billjones@example.com --display_name="Bill Jones" --role=administrator |
113115
And I run `wp user add-role billjones author`
114116
Then STDOUT should not be empty
115117

0 commit comments

Comments
 (0)