Skip to content

Commit 08f7887

Browse files
authored
Merge pull request #98 from wp-cli/fix/make-transient-test-more-robust
Make transient test more robust against added transients by core
2 parents 1dbb59e + fb3c95e commit 08f7887

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

features/transient.feature

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Feature: Manage WordPress transient cache
6060
# We set `WP_DEVELOPMENT_MODE` to stop WordPress from automatically creating
6161
# additional transients which cause some steps to fail when testing.
6262
And I run `wp config set WP_DEVELOPMENT_MODE all`
63+
And I run `wp config set DISABLE_WP_CRON true --raw`
64+
6365
And I run `wp transient list --format=count`
6466
And save STDOUT as {EXISTING_TRANSIENTS}
6567
And I run `expr {EXISTING_TRANSIENTS} + 2`
@@ -75,6 +77,7 @@ Feature: Manage WordPress transient cache
7577
And I run `wp transient set foo2 bar2 600`
7678
And I run `wp transient set foo3 bar3 --network`
7779
And I run `wp transient set foo4 bar4 600 --network`
80+
7881
And I run `wp transient delete --all`
7982
Then STDOUT should be:
8083
"""
@@ -405,9 +408,14 @@ Feature: Manage WordPress transient cache
405408
When I run `wp transient list --format=csv`
406409
Then STDOUT should contain:
407410
"""
408-
name,value,expiration
409411
foo,bar,false
412+
"""
413+
And STDOUT should contain:
414+
"""
410415
foo2,bar2,95649119999
416+
"""
417+
And STDOUT should contain:
418+
"""
411419
foo3,bar3,1321009871
412420
"""
413421

@@ -458,9 +466,14 @@ Feature: Manage WordPress transient cache
458466
When I run `wp transient list --format=csv`
459467
Then STDOUT should contain:
460468
"""
461-
name,value,expiration
462469
foo,bar,false
470+
"""
471+
And STDOUT should contain:
472+
"""
463473
foo2,bar2,95649119999
474+
"""
475+
And STDOUT should contain:
476+
"""
464477
foo3,bar3,1321009871
465478
"""
466479

0 commit comments

Comments
 (0)