Skip to content

Commit d4cea11

Browse files
committed
Adapt tests for PHP 8.1+
1 parent 47f67c7 commit d4cea11

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

features/requests.feature

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ Feature: Requests integration with both v1 and v2
145145
"""
146146
require __DIR__ . "/../vendor/autoload.php";
147147
"""
148+
And the {RUN_DIR}/vendor/wp-cli/wp-cli/bundle/rmccue/requests directory should exist
149+
And the {RUN_DIR}/vendor/rmccue/requests directory should not exist
148150

149151
When I run `vendor/bin/wp config create --dbname={DB_NAME} --dbuser={DB_USER} --dbpass={DB_PASSWORD} --dbhost={DB_HOST} --extra-php < extra-config.php`
150152
Then STDOUT should be:
@@ -170,7 +172,8 @@ Feature: Requests integration with both v1 and v2
170172
Success: Database created.
171173
"""
172174
173-
When I run `vendor/bin/wp core install --url=localhost:8181 --title=Composer --admin_user=admin --admin_password=password [email protected]`
175+
# This can throw deprecated warnings on PHP 8.1+.
176+
When I try `vendor/bin/wp core install --url=localhost:8181 --title=Composer --admin_user=admin --admin_password=password [email protected]`
174177
Then STDOUT should contain:
175178
"""
176179
Success: WordPress installed successfully.
@@ -182,7 +185,8 @@ Feature: Requests integration with both v1 and v2
182185
6.1
183186
"""
184187
185-
When I run `vendor/bin/wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
188+
# This can throw deprecated warnings on PHP 8.1+.
189+
When I try `vendor/bin/wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
186190
Then STDOUT should contain:
187191
"""
188192
object(Requests_Response)
@@ -191,9 +195,9 @@ Feature: Requests integration with both v1 and v2
191195
"""
192196
HTTP/1.1 200 OK
193197
"""
194-
And STDERR should be empty
195198
196-
When I run `vendor/bin/wp plugin install duplicate-post --activate`
199+
# This can throw deprecated warnings on PHP 8.1+.
200+
When I try `vendor/bin/wp plugin install duplicate-post --activate`
197201
Then STDOUT should contain:
198202
"""
199203
Success: Installed 1 of 1 plugins.

0 commit comments

Comments
 (0)