Skip to content

Commit 224f78d

Browse files
authored
Fix PHPCS errors in Behat test files (#98)
1 parent 624c2e4 commit 224f78d

3 files changed

Lines changed: 26 additions & 11 deletions

File tree

‎features/cache.feature‎

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Feature: Manage oEmbed cache.
7979
# Add a non-post embed, default attributes.
8080
Given a step1.php file:
8181
"""
82-
<?php echo $GLOBALS["wp_embed"]->run_shortcode( "[embed]https://www.youtube.com/watch?v=dQw4w9WgXcQ[/embed]" );
82+
<?php echo $GLOBALS['wp_embed']->run_shortcode( '[embed]https://www.youtube.com/watch?v=dQw4w9WgXcQ[/embed]' );
8383
"""
8484
When I run `wp eval-file step1.php`
8585
Then STDOUT should contain:
@@ -93,7 +93,7 @@ Feature: Manage oEmbed cache.
9393
# Add a non-post embed with width attribute.
9494
Given a step2.php file:
9595
"""
96-
<?php echo $GLOBALS["wp_embed"]->run_shortcode( "[embed width=400]https://www.youtube.com/watch?v=yPYZpwSpKmA[/embed]" );
96+
<?php echo $GLOBALS['wp_embed']->run_shortcode( '[embed width=400]https://www.youtube.com/watch?v=yPYZpwSpKmA[/embed]' );
9797
"""
9898
When I run `wp eval-file step2.php`
9999
Then STDOUT should contain:
@@ -124,7 +124,7 @@ Feature: Manage oEmbed cache.
124124
# Add a non-post embed with discover=1 attribute.
125125
Given a step3.php file:
126126
"""
127-
<?php echo $GLOBALS["wp_embed"]->run_shortcode( "[embed discover=1]https://www.youtube.com/watch?v=yBwD4iYcWC4[/embed]" );
127+
<?php echo $GLOBALS['wp_embed']->run_shortcode( '[embed discover=1]https://www.youtube.com/watch?v=yBwD4iYcWC4[/embed]' );
128128
"""
129129
When I run `wp eval-file step3.php`
130130
Then STDOUT should contain:
@@ -151,7 +151,7 @@ Feature: Manage oEmbed cache.
151151
# Add a non-post embed with width and discover attributes.
152152
Given a step4.php file:
153153
"""
154-
<?php echo $GLOBALS["wp_embed"]->run_shortcode( "[embed width=450 discover=0]https://www.youtube.com/watch?v=eYuUAGXN0KM[/embed]" );
154+
<?php echo $GLOBALS['wp_embed']->run_shortcode( '[embed width=450 discover=0]https://www.youtube.com/watch?v=eYuUAGXN0KM[/embed]' );
155155
"""
156156
When I run `wp eval-file step4.php`
157157
Then STDOUT should contain:
@@ -196,7 +196,7 @@ Feature: Manage oEmbed cache.
196196
# Dummy data with default width/height.
197197
Given a step5.php file:
198198
"""
199-
<?php echo md5( "foo" . serialize( wp_embed_defaults() ) );
199+
<?php echo md5( 'foo' . serialize( wp_embed_defaults() ) );
200200
"""
201201
When I run `wp eval-file step5.php`
202202
Then STDOUT should not be empty
@@ -215,7 +215,14 @@ Feature: Manage oEmbed cache.
215215
# Dummy data with given width/height. Specify width/height as strings as that's what shortcode attributes will be passed as.
216216
Given a step6.php file:
217217
"""
218-
<?php echo md5( "foo" . serialize( array( "width" => "600", "height" => "400" ) ) );
218+
<?php echo md5(
219+
'foo' . serialize(
220+
array(
221+
'width' => '600',
222+
'height' => '400',
223+
)
224+
)
225+
);
219226
"""
220227
When I run `wp eval-file step6.php`
221228
Then STDOUT should not be empty

‎features/handler.feature‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ Feature: Manage embed handlers.
5757

5858
Given an embed_register_handler.php file:
5959
"""
60-
<?php WP_CLI::add_hook( 'after_wp_load', function() { wp_embed_register_handler( 'my_id', '/regex/', 'callback', 123 ); } );
60+
<?php WP_CLI::add_hook(
61+
'after_wp_load',
62+
function () {
63+
wp_embed_register_handler( 'my_id', '/regex/', 'callback', 123 );
64+
}
65+
);
6166
"""
6267

6368
When I run `wp --require=embed_register_handler.php embed handler list`

‎features/provider.feature‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ Feature: Manage oEmbed providers.
55
And a filter-providers.php file:
66
"""
77
<?php
8-
WP_CLI::add_wp_hook( 'oembed_providers', function ( $providers ) {
9-
$providers['http://example.com/*'] = [ 'http://example.com/api/oembed.{format}', false ];
10-
return $providers;
11-
});
8+
WP_CLI::add_wp_hook(
9+
'oembed_providers',
10+
function ( $providers ) {
11+
$providers['http://example.com/*'] = [ 'http://example.com/api/oembed.{format}', false ];
12+
return $providers;
13+
}
14+
);
1215
"""
1316

1417
Scenario: List oEmbed providers

0 commit comments

Comments
 (0)