From 735d82acff3928e2a613da21359e22c9c7d4fa3c Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 24 Mar 2026 22:40:13 +0100 Subject: [PATCH] Fix failing tests when object cache is on --- features/comment-recount.feature | 2 +- features/menu-item.feature | 1 + features/option-list.feature | 1 + features/term-recount.feature | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/features/comment-recount.feature b/features/comment-recount.feature index 538f235c6..4a773de68 100644 --- a/features/comment-recount.feature +++ b/features/comment-recount.feature @@ -11,7 +11,7 @@ Feature: Recount comments on a post 3 """ - When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) );'` + When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->posts, array( "comment_count" => 1 ), array( "ID" => 1 ) ); clean_post_cache( 1 );'` And I run `wp post get 1 --field=comment_count` Then STDOUT should be: """ diff --git a/features/menu-item.feature b/features/menu-item.feature index 6d4cc407d..5d73bf0ae 100644 --- a/features/menu-item.feature +++ b/features/menu-item.feature @@ -103,6 +103,7 @@ Feature: Manage WordPress menu items | Child | {CHILD_ID} | {PARENT_ID} | When I run `wp menu item delete {PARENT_ID}` + And I run `wp cache flush` And I run `wp menu item list grandparent-test --fields=title,db_id,menu_item_parent` Then STDOUT should be a table containing rows: | title | db_id | menu_item_parent | diff --git a/features/option-list.feature b/features/option-list.feature index 5e285730b..265252222 100644 --- a/features/option-list.feature +++ b/features/option-list.feature @@ -1,5 +1,6 @@ Feature: List WordPress options + @skip-object-cache Scenario: Using the `--transients` flag Given a WP install And I run `wp transient set wp_transient_flag wp_transient_flag` diff --git a/features/term-recount.feature b/features/term-recount.feature index 802c230d1..c7442aec0 100644 --- a/features/term-recount.feature +++ b/features/term-recount.feature @@ -40,7 +40,7 @@ Feature: Recount terms on a taxonomy """ 1 """ - When I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->term_taxonomy, array( "count" => 3 ), array( "term_id" => {TERM_ID} ) );'` + 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" );'` And I run `wp term get category {TERM_ID} --field=count` Then STDOUT should be: """