Skip to content

Commit bfc130f

Browse files
authored
Fix failing tests when object cache is on (#607)
1 parent 22bcd45 commit bfc130f

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

features/comment-recount.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Feature: Recount comments on a post
1111
3
1212
"""
1313

14-
When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) );'`
14+
When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) ); clean_post_cache( 1 );'`
1515
And I run `wp post get 1 --field=comment_count`
1616
Then STDOUT should be:
1717
"""

features/menu-item.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Feature: Manage WordPress menu items
103103
| Child | {CHILD_ID} | {PARENT_ID} |
104104

105105
When I run `wp menu item delete {PARENT_ID}`
106+
And I run `wp cache flush`
106107
And I run `wp menu item list grandparent-test --fields=title,db_id,menu_item_parent`
107108
Then STDOUT should be a table containing rows:
108109
| title | db_id | menu_item_parent |

features/option-list.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Feature: List WordPress options
22

3+
@skip-object-cache
34
Scenario: Using the `--transients` flag
45
Given a WP install
56
And I run `wp transient set wp_transient_flag wp_transient_flag`

features/term-recount.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Feature: Recount terms on a taxonomy
4040
"""
4141
1
4242
"""
43-
When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->term_taxonomy, array( "count" => 3 ), array( "term_id" => {TERM_ID} ) );'`
43+
When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->term_taxonomy, array( "count" => 3 ), array( "term_id" => {TERM_ID} ) ); clean_term_cache( {TERM_ID}, "category" );'`
4444
And I run `wp term get category {TERM_ID} --field=count`
4545
Then STDOUT should be:
4646
"""

0 commit comments

Comments
 (0)