Skip to content

Commit

Permalink
Merge pull request #74 from wp-cli/fix/make-transient-delete-test-mor…
Browse files Browse the repository at this point in the history
…e-robust
  • Loading branch information
schlessera authored Oct 12, 2022
2 parents 0db0214 + be15fc6 commit 69e0f78
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions features/transient.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Feature: Manage WordPress transient cache

Scenario: Deleting all transients on single site
Given a WP install
And I run `wp transient list --format=count`
And save STDOUT as {EXISTING_TRANSIENTS}
And I run `expr {EXISTING_TRANSIENTS} + 2`
And save STDOUT as {EXPECTED_TRANSIENTS}

When I try `wp transient delete`
Then STDERR should be:
Expand All @@ -71,7 +75,7 @@ Feature: Manage WordPress transient cache
And I run `wp transient delete --all`
Then STDOUT should be:
"""
Success: 2 transients deleted from the database.
Success: {EXPECTED_TRANSIENTS} transients deleted from the database.
"""

When I try `wp transient get foo`
Expand Down Expand Up @@ -190,6 +194,10 @@ Feature: Manage WordPress transient cache
Scenario: Deleting all transients on multisite
Given a WP multisite install
And I run `wp site create --slug=foo`
And I run `wp transient list --format=count`
And save STDOUT as {EXISTING_TRANSIENTS}
And I run `expr {EXISTING_TRANSIENTS} + 2`
And save STDOUT as {EXPECTED_TRANSIENTS}

When I try `wp transient delete`
Then STDERR should be:
Expand All @@ -206,7 +214,7 @@ Feature: Manage WordPress transient cache
And I run `wp transient delete --all`
Then STDOUT should be:
"""
Success: 2 transients deleted from the database.
Success: {EXPECTED_TRANSIENTS} transients deleted from the database.
"""

When I try `wp transient get foo`
Expand Down Expand Up @@ -389,7 +397,7 @@ Feature: Manage WordPress transient cache
And I run `wp option update _site_transient_timeout_foo6 1321009871`

When I run `wp transient list --format=csv`
Then STDOUT should be:
Then STDOUT should contain:
"""
name,value,expiration
foo,bar,false
Expand Down Expand Up @@ -434,7 +442,7 @@ Feature: Manage WordPress transient cache
And I run `wp site option update _site_transient_timeout_foo6 1321009871`

When I run `wp transient list --format=csv`
Then STDOUT should be:
Then STDOUT should contain:
"""
name,value,expiration
foo,bar,false
Expand Down

0 comments on commit 69e0f78

Please sign in to comment.