From 8a78b0f5b8ca93e7f64b4063401cbb16eef5a90c Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 1 Sep 2026 12:34:23 +0200 Subject: [PATCH 1/2] Fix PHPCS errors in Behat test files --- features/cache-patch.feature | 26 +++++++++++++------------- features/cache-pluck.feature | 8 ++++---- features/cache.feature | 32 ++++++++++++++++---------------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/features/cache-patch.feature b/features/cache-patch.feature index fe027adb..89083e9d 100644 --- a/features/cache-patch.feature +++ b/features/cache-patch.feature @@ -5,19 +5,19 @@ Feature: Patch command available for the object cache And a wp-content/mu-plugins/test-harness.php file: """php 'bar'] ); - wp_cache_set( 'other_key', ['fuz' => 'biz'] ); - wp_cache_set( 'my_key_in_group', ['fuz' => 'biz'], 'my_group' ); - - $complex_key = (object) [ - 'foo' => (object) [ - 'bar' => (object) [ - 'baz' => 2, - ], - ], - ]; - wp_cache_set( 'complex_key', $complex_key ); + $set_foo = function () { + wp_cache_set( 'my_key', [ 'foo' => 'bar' ] ); + wp_cache_set( 'other_key', [ 'fuz' => 'biz' ] ); + wp_cache_set( 'my_key_in_group', [ 'fuz' => 'biz' ], 'my_group' ); + + $complex_key = (object) [ + 'foo' => (object) [ + 'bar' => (object) [ + 'baz' => 2, + ], + ], + ]; + wp_cache_set( 'complex_key', $complex_key ); }; WP_CLI::add_hook( 'before_invoke:cache patch', $set_foo ); diff --git a/features/cache-pluck.feature b/features/cache-pluck.feature index c930b084..c567d089 100644 --- a/features/cache-pluck.feature +++ b/features/cache-pluck.feature @@ -5,10 +5,10 @@ Feature: Pluck command available for the object cache And a wp-content/mu-plugins/test-harness.php file: """php 'bar'] ); - wp_cache_set( 'my_key_2', ['foo' => ['bar' => 'baz']] ); - wp_cache_set( 'my_key_3', ['foo' => 'bar_custom'], 'my_custom_group' ); + $set_foo = function () { + wp_cache_set( 'my_key', [ 'foo' => 'bar' ] ); + wp_cache_set( 'my_key_2', [ 'foo' => [ 'bar' => 'baz' ] ] ); + wp_cache_set( 'my_key_3', [ 'foo' => 'bar_custom' ], 'my_custom_group' ); }; WP_CLI::add_hook( 'before_invoke:cache pluck', $set_foo ); diff --git a/features/cache.feature b/features/cache.feature index 21c23a66..f5b24f29 100644 --- a/features/cache.feature +++ b/features/cache.feature @@ -6,14 +6,14 @@ Feature: Managed the WordPress object cache And a wp-content/mu-plugins/test-harness.php file: """ Date: Tue, 1 Sep 2026 12:42:30 +0200 Subject: [PATCH 2/2] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- features/cache.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/cache.feature b/features/cache.feature index f5b24f29..c0a1d8c9 100644 --- a/features/cache.feature +++ b/features/cache.feature @@ -4,7 +4,7 @@ Feature: Managed the WordPress object cache Scenario: Default group is 'default' Given a WP install And a wp-content/mu-plugins/test-harness.php file: - """ + """php