Skip to content

Commit e8da1b9

Browse files
committed
Fix some eval tests
1 parent 8f5310c commit e8da1b9

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

features/requests.feature

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ Feature: Requests integration with both v1 and v2
3636
5.8
3737
"""
3838

39-
When I run `vendor/bin/wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
39+
Given a check-request-v1-phar.php file:
40+
"""
41+
<?php
42+
var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );
43+
"""
44+
When I run `vendor/bin/wp eval-file check-request-v1-phar.php`
4045
Then STDOUT should contain:
4146
"""
4247
object(Requests_Response)
@@ -60,7 +65,12 @@ Feature: Requests integration with both v1 and v2
6065
5.8
6166
"""
6267

63-
When I run `wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
68+
Given a check-request-v1.php file:
69+
"""
70+
<?php
71+
var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );
72+
"""
73+
When I run `wp eval-file check-request-v1.php`
6474
Then STDOUT should contain:
6575
"""
6676
object(Requests_Response)
@@ -91,7 +101,12 @@ Feature: Requests integration with both v1 and v2
91101
6.2
92102
"""
93103

94-
When I run `wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
104+
Given a check-request-v2.php file:
105+
"""
106+
<?php
107+
var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );
108+
"""
109+
When I run `wp eval-file check-request-v2.php`
95110
Then STDOUT should contain:
96111
"""
97112
object(WpOrg\Requests\Response)
@@ -200,7 +215,12 @@ Feature: Requests integration with both v1 and v2
200215
"""
201216
202217
# This can throw deprecated warnings on PHP 8.1+.
203-
When I try `vendor/bin/wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
218+
Given a check-request-v2-phar.php file:
219+
"""
220+
<?php
221+
var_dump( \WP_CLI\Utils\http_request( 'GET', 'https://example.com/' ) );
222+
"""
223+
When I try `vendor/bin/wp eval-file check-request-v2-phar.php`
204224
Then STDOUT should contain:
205225
"""
206226
object(Requests_Response)
@@ -227,11 +247,11 @@ Feature: Requests integration with both v1 and v2
227247
Just another Composer-based WordPress site
228248
"""
229249
230-
When I run `vendor/bin/wp eval 'echo COOKIEHASH;'`
250+
When I run `vendor/bin/wp eval "echo COOKIEHASH;"`
231251
And save STDOUT as {COOKIEHASH}
232252
Then STDOUT should not be empty
233253
234-
When I run `vendor/bin/wp eval 'echo wp_generate_auth_cookie( 1, 32503680000 );'`
254+
When I run `vendor/bin/wp eval "echo wp_generate_auth_cookie( 1, 32503680000 );"`
235255
And save STDOUT as {AUTH_COOKIE}
236256
Then STDOUT should not be empty
237257

0 commit comments

Comments
 (0)