Skip to content

Commit 247052d

Browse files
schlesseraclaude
andcommitted
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 89a862c commit 247052d

4 files changed

Lines changed: 102 additions & 68 deletions

File tree

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"require-dev": {
1818
"wp-cli/entity-command": "^1.3 || ^2 || ^3",
19-
"wp-cli/wp-cli-tests": "^5"
19+
"wp-cli/wp-cli-tests": "dev-setup-commands-step as 5.3.99"
2020
},
2121
"config": {
2222
"process-timeout": 7200,

‎features/transient-patch.feature‎

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ Feature: Patch command available for the transient cache
22

33
Scenario: Nested values from transient can be inserted at any depth.
44
Given a WP install
5-
And I run `wp eval "set_transient( 'my_key', ['foo' => 'bar'] );"`
6-
And I run `wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
5+
And these setup commands:
6+
| command |
7+
| wp eval "set_transient( 'my_key', ['foo' => 'bar'] );" |
8+
| wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
79

810
When I run `wp transient patch insert my_key fuz baz`
911
Then STDOUT should be:
@@ -73,8 +75,10 @@ Feature: Patch command available for the transient cache
7375

7476
Scenario: Nested values from transient can be updated at any depth.
7577
Given a WP install
76-
And I run `wp eval "set_transient( 'my_key', ['foo' => 'bar'] );"`
77-
And I run `wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
78+
And these setup commands:
79+
| command |
80+
| wp eval "set_transient( 'my_key', ['foo' => 'bar'] );" |
81+
| wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
7882

7983
When I run `wp transient patch update my_key foo baz`
8084
Then STDOUT should be:
@@ -132,8 +136,10 @@ Feature: Patch command available for the transient cache
132136

133137
Scenario: Nested values from transient can be deleted at any depth.
134138
Given a WP install
135-
And I run `wp eval "set_transient( 'my_key', ['foo' => 'bar'] );"`
136-
And I run `wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
139+
And these setup commands:
140+
| command |
141+
| wp eval "set_transient( 'my_key', ['foo' => 'bar'] );" |
142+
| wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
137143

138144
When I run `wp transient patch delete my_key foo`
139145
Then STDOUT should be:
@@ -179,8 +185,10 @@ Feature: Patch command available for the transient cache
179185

180186
Scenario: Nested values from site transient can be inserted at any depth.
181187
Given a WP multisite install
182-
And I run `wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );"`
183-
And I run `wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
188+
And these setup commands:
189+
| command |
190+
| wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );" |
191+
| wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
184192

185193
When I run `wp transient patch insert my_key fuz baz --network`
186194
Then STDOUT should be:
@@ -238,8 +246,10 @@ Feature: Patch command available for the transient cache
238246

239247
Scenario: Nested values from site transient can be updated at any depth.
240248
Given a WP multisite install
241-
And I run `wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );"`
242-
And I run `wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
249+
And these setup commands:
250+
| command |
251+
| wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );" |
252+
| wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
243253

244254
When I run `wp transient patch update my_key foo baz --network`
245255
Then STDOUT should be:
@@ -297,8 +307,10 @@ Feature: Patch command available for the transient cache
297307

298308
Scenario: Nested values from site transient can be deleted at any depth.
299309
Given a WP multisite install
300-
And I run `wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );"`
301-
And I run `wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
310+
And these setup commands:
311+
| command |
312+
| wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );" |
313+
| wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
302314

303315
When I run `wp transient patch delete my_key foo --network`
304316
Then STDOUT should be:

‎features/transient-pluck.feature‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ Feature: Pluck command available for the transient cache
22

33
Scenario: Nested values from transient can be retrieved at any depth.
44
Given a WP install
5-
And I run `wp eval "set_transient( 'my_key', ['foo' => 'bar'] );"`
6-
And I run `wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
5+
And these setup commands:
6+
| command |
7+
| wp eval "set_transient( 'my_key', ['foo' => 'bar'] );" |
8+
| wp eval "set_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
79

810
When I run `wp transient pluck my_key foo`
911
Then STDOUT should be:
@@ -37,8 +39,10 @@ Feature: Pluck command available for the transient cache
3739

3840
Scenario: Nested values from site transient can be retrieved at any depth.
3941
Given a WP multisite install
40-
And I run `wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );"`
41-
And I run `wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );"`
42+
And these setup commands:
43+
| command |
44+
| wp eval "set_site_transient( 'my_key', ['foo' => 'bar'] );" |
45+
| wp eval "set_site_transient( 'my_key_2', ['foo' => ['bar' => 'baz']] );" |
4246

4347
When I run `wp transient pluck my_key foo --network`
4448
Then STDOUT should be:

‎features/transient.feature‎

Lines changed: 69 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ Feature: Manage WordPress transient cache
7373
Error: Please specify transient key, or use --all or --expired.
7474
"""
7575

76-
When I run `wp transient set foo bar`
77-
And I run `wp transient set foo2 bar2 600`
78-
And I run `wp transient set foo3 bar3 --network`
79-
And I run `wp transient set foo4 bar4 600 --network`
76+
Given these setup commands:
77+
| command |
78+
| wp transient set foo bar |
79+
| wp transient set foo2 bar2 600 |
80+
| wp transient set foo3 bar3 --network |
81+
| wp transient set foo4 bar4 600 --network |
8082

8183
And I run `wp transient delete --all`
8284
Then STDOUT should be:
@@ -129,13 +131,17 @@ Feature: Manage WordPress transient cache
129131
@skip-object-cache
130132
Scenario: Deleting expired transients on single site
131133
Given a WP install
132-
And I run `wp transient set foo bar 600`
133-
And I run `wp transient set foo2 bar2 600`
134-
And I run `wp transient set foo3 bar3 600 --network`
135-
And I run `wp transient set foo4 bar4 600 --network`
134+
And these setup commands:
135+
| command |
136+
| wp transient set foo bar 600 |
137+
| wp transient set foo2 bar2 600 |
138+
| wp transient set foo3 bar3 600 --network |
139+
| wp transient set foo4 bar4 600 --network |
136140
# Change timeout to be in the past.
137-
And I run `wp option update _transient_timeout_foo 1321009871`
138-
And I run `wp option update _site_transient_timeout_foo3 1321009871`
141+
And these setup commands:
142+
| command |
143+
| wp option update _transient_timeout_foo 1321009871 |
144+
| wp option update _site_transient_timeout_foo3 1321009871 |
139145

140146
When I run `wp transient delete --expired`
141147
Then STDOUT should be:
@@ -216,13 +222,15 @@ Feature: Manage WordPress transient cache
216222
Error: Please specify transient key, or use --all or --expired.
217223
"""
218224

219-
When I run `wp transient set foo bar`
220-
And I run `wp transient set foo2 bar2 600`
221-
And I run `wp transient set foo3 bar3 --network`
222-
And I run `wp transient set foo4 bar4 600 --network`
223-
And I run `wp --url=example.com/foo transient set foo5 bar5 --network`
224-
And I run `wp --url=example.com/foo transient set foo6 bar6 600 --network`
225-
And I run `wp transient delete --all`
225+
Given these setup commands:
226+
| command |
227+
| wp transient set foo bar |
228+
| wp transient set foo2 bar2 600 |
229+
| wp transient set foo3 bar3 --network |
230+
| wp transient set foo4 bar4 600 --network |
231+
| wp --url=example.com/foo transient set foo5 bar5 --network |
232+
| wp --url=example.com/foo transient set foo6 bar6 600 --network |
233+
When I run `wp transient delete --all`
226234
Then STDOUT should be:
227235
"""
228236
Success: {EXPECTED_TRANSIENTS} transients deleted from the database.
@@ -298,16 +306,20 @@ Feature: Manage WordPress transient cache
298306
Scenario: Deleting expired transients on multisite
299307
Given a WP multisite install
300308
And I run `wp site create --slug=foo`
301-
And I run `wp transient set foo bar 600`
302-
And I run `wp transient set foo2 bar2 600`
303-
And I run `wp transient set foo3 bar3 600 --network`
304-
And I run `wp transient set foo4 bar4 600 --network`
305-
And I run `wp --url=example.com/foo transient set foo5 bar5 600 --network`
306-
And I run `wp --url=example.com/foo transient set foo6 bar6 600 --network`
309+
And these setup commands:
310+
| command |
311+
| wp transient set foo bar 600 |
312+
| wp transient set foo2 bar2 600 |
313+
| wp transient set foo3 bar3 600 --network |
314+
| wp transient set foo4 bar4 600 --network |
315+
| wp --url=example.com/foo transient set foo5 bar5 600 --network |
316+
| wp --url=example.com/foo transient set foo6 bar6 600 --network |
307317
# Change timeout to be in the past.
308-
And I run `wp option update _transient_timeout_foo 1321009871`
309-
And I run `wp site option update _site_transient_timeout_foo3 1321009871`
310-
And I run `wp --url=example.com/foo site option update _site_transient_timeout_foo5 1321009871`
318+
And these setup commands:
319+
| command |
320+
| wp option update _transient_timeout_foo 1321009871 |
321+
| wp site option update _site_transient_timeout_foo3 1321009871 |
322+
| wp --url=example.com/foo site option update _site_transient_timeout_foo5 1321009871 |
311323

312324
When I run `wp transient delete --expired`
313325
Then STDOUT should be:
@@ -398,16 +410,18 @@ Feature: Manage WordPress transient cache
398410
@skip-object-cache
399411
Scenario: List transients on single site
400412
Given a WP install
401-
And I run `wp transient set foo bar`
402-
And I run `wp transient set foo2 bar2 610`
403-
And I run `wp option update _transient_timeout_foo2 95649119999`
404-
And I run `wp transient set foo3 bar3 300`
405-
And I run `wp option update _transient_timeout_foo3 1321009871`
406-
And I run `wp transient set foo4 bar4 --network`
407-
And I run `wp transient set foo5 bar5 610 --network`
408-
And I run `wp option update _site_transient_timeout_foo5 95649119999`
409-
And I run `wp transient set foo6 bar6 300 --network`
410-
And I run `wp option update _site_transient_timeout_foo6 1321009871`
413+
And these setup commands:
414+
| command |
415+
| wp transient set foo bar |
416+
| wp transient set foo2 bar2 610 |
417+
| wp option update _transient_timeout_foo2 95649119999 |
418+
| wp transient set foo3 bar3 300 |
419+
| wp option update _transient_timeout_foo3 1321009871 |
420+
| wp transient set foo4 bar4 --network |
421+
| wp transient set foo5 bar5 610 --network |
422+
| wp option update _site_transient_timeout_foo5 95649119999 |
423+
| wp transient set foo6 bar6 300 --network |
424+
| wp option update _site_transient_timeout_foo6 1321009871 |
411425

412426
When I run `wp transient list --format=csv`
413427
Then STDOUT should contain:
@@ -457,16 +471,18 @@ Feature: Manage WordPress transient cache
457471
# We set `WP_DEVELOPMENT_MODE` to stop WordPress from automatically creating
458472
# additional transients which cause some steps to fail when testing.
459473
And I run `wp config set WP_DEVELOPMENT_MODE all`
460-
And I run `wp transient set foo bar`
461-
And I run `wp transient set foo2 bar2 610`
462-
And I run `wp option update _transient_timeout_foo2 95649119999`
463-
And I run `wp transient set foo3 bar3 300`
464-
And I run `wp option update _transient_timeout_foo3 1321009871`
465-
And I run `wp transient set foo4 bar4 --network`
466-
And I run `wp transient set foo5 bar5 610 --network`
467-
And I run `wp site option update _site_transient_timeout_foo5 95649119999`
468-
And I run `wp transient set foo6 bar6 300 --network`
469-
And I run `wp site option update _site_transient_timeout_foo6 1321009871`
474+
And these setup commands:
475+
| command |
476+
| wp transient set foo bar |
477+
| wp transient set foo2 bar2 610 |
478+
| wp option update _transient_timeout_foo2 95649119999 |
479+
| wp transient set foo3 bar3 300 |
480+
| wp option update _transient_timeout_foo3 1321009871 |
481+
| wp transient set foo4 bar4 --network |
482+
| wp transient set foo5 bar5 610 --network |
483+
| wp site option update _site_transient_timeout_foo5 95649119999 |
484+
| wp transient set foo6 bar6 300 --network |
485+
| wp site option update _site_transient_timeout_foo6 1321009871 |
470486

471487
When I run `wp transient list --format=csv`
472488
Then STDOUT should contain:
@@ -513,11 +529,13 @@ Feature: Manage WordPress transient cache
513529
@skip-object-cache
514530
Scenario: List transients with search and exclude pattern
515531
Given a WP install
516-
And I run `wp transient set foo bar`
517-
And I run `wp transient set foo2 bar2`
518-
And I run `wp transient set foo3 bar3`
519-
And I run `wp transient set foo4 bar4 --network`
520-
And I run `wp transient set foo5 bar5 --network`
532+
And these setup commands:
533+
| command |
534+
| wp transient set foo bar |
535+
| wp transient set foo2 bar2 |
536+
| wp transient set foo3 bar3 |
537+
| wp transient set foo4 bar4 --network |
538+
| wp transient set foo5 bar5 --network |
521539

522540
When I run `wp transient list --format=csv --fields=name --search="foo"`
523541
Then STDOUT should be:

0 commit comments

Comments
 (0)