Skip to content

Commit 7d21cb5

Browse files
swissspidyCopilot
andauthored
Fix PHPCS errors in Behat test files (#130)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent ab1efd8 commit 7d21cb5

3 files changed

Lines changed: 34 additions & 34 deletions

File tree

‎features/cache-patch.feature‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ Feature: Patch command available for the object cache
55
And a wp-content/mu-plugins/test-harness.php file:
66
"""php
77
<?php
8-
$set_foo = function(){
9-
wp_cache_set( 'my_key', ['foo' => 'bar'] );
10-
wp_cache_set( 'other_key', ['fuz' => 'biz'] );
11-
wp_cache_set( 'my_key_in_group', ['fuz' => 'biz'], 'my_group' );
12-
13-
$complex_key = (object) [
14-
'foo' => (object) [
15-
'bar' => (object) [
16-
'baz' => 2,
17-
],
18-
],
19-
];
20-
wp_cache_set( 'complex_key', $complex_key );
8+
$set_foo = function () {
9+
wp_cache_set( 'my_key', [ 'foo' => 'bar' ] );
10+
wp_cache_set( 'other_key', [ 'fuz' => 'biz' ] );
11+
wp_cache_set( 'my_key_in_group', [ 'fuz' => 'biz' ], 'my_group' );
12+
13+
$complex_key = (object) [
14+
'foo' => (object) [
15+
'bar' => (object) [
16+
'baz' => 2,
17+
],
18+
],
19+
];
20+
wp_cache_set( 'complex_key', $complex_key );
2121
};
2222
2323
WP_CLI::add_hook( 'before_invoke:cache patch', $set_foo );

‎features/cache-pluck.feature‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Feature: Pluck command available for the object cache
55
And a wp-content/mu-plugins/test-harness.php file:
66
"""php
77
<?php
8-
$set_foo = function(){
9-
wp_cache_set( 'my_key', ['foo' => 'bar'] );
10-
wp_cache_set( 'my_key_2', ['foo' => ['bar' => 'baz']] );
11-
wp_cache_set( 'my_key_3', ['foo' => 'bar_custom'], 'my_custom_group' );
8+
$set_foo = function () {
9+
wp_cache_set( 'my_key', [ 'foo' => 'bar' ] );
10+
wp_cache_set( 'my_key_2', [ 'foo' => [ 'bar' => 'baz' ] ] );
11+
wp_cache_set( 'my_key_3', [ 'foo' => 'bar_custom' ], 'my_custom_group' );
1212
};
1313
1414
WP_CLI::add_hook( 'before_invoke:cache pluck', $set_foo );

‎features/cache.feature‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ Feature: Managed the WordPress object cache
44
Scenario: Default group is 'default'
55
Given a WP install
66
And a wp-content/mu-plugins/test-harness.php file:
7-
"""
7+
"""php
88
<?php
9-
$set_foo = function(){
10-
wp_cache_set( 'foo', 'bar' );
9+
$set_foo = function () {
10+
wp_cache_set( 'foo', 'bar' );
1111
};
12-
$set_foo_value = function() {
13-
wp_cache_set( 'foo', 2 );
12+
$set_foo_value = function () {
13+
wp_cache_set( 'foo', 2 );
1414
};
15-
$log_foo_value = function() {
16-
WP_CLI::log( var_export( wp_cache_get( 'foo' ), true ) );
15+
$log_foo_value = function () {
16+
WP_CLI::log( var_export( wp_cache_get( 'foo' ), true ) );
1717
};
1818
WP_CLI::add_hook( 'before_invoke:cache get', $set_foo );
1919
WP_CLI::add_hook( 'before_invoke:cache delete', $set_foo );
@@ -150,12 +150,12 @@ Feature: Managed the WordPress object cache
150150
"""php
151151
<?php
152152
class Dummy_Object_Cache extends WP_Object_Cache {
153-
public function flush_group( $group ) {
154-
if ( $group === 'permanent_root_cache' ) {
155-
return false;
153+
public function flush_group( $group ) {
154+
if ( $group === 'permanent_root_cache' ) {
155+
return false;
156+
}
157+
return parent::flush_group( $group );
156158
}
157-
return parent::flush_group( $group );
158-
}
159159
}
160160
$GLOBALS['wp_object_cache'] = new Dummy_Object_Cache();
161161
"""
@@ -172,12 +172,12 @@ Feature: Managed the WordPress object cache
172172
"""php
173173
<?php
174174
class Dummy_Object_Cache extends WP_Object_Cache {
175-
public function flush_group( $group ) {
176-
if ( $group === 'permanent_root_cache' ) {
177-
return false;
175+
public function flush_group( $group ) {
176+
if ( $group === 'permanent_root_cache' ) {
177+
return false;
178+
}
179+
return parent::flush_group( $group );
178180
}
179-
return parent::flush_group( $group );
180-
}
181181
}
182182
$GLOBALS['wp_object_cache'] = new Dummy_Object_Cache();
183183
"""

0 commit comments

Comments
 (0)