Skip to content

Commit 7c413f0

Browse files
authored
Merge pull request #540 from wp-cli/fix/adapt-tests-for-requests
2 parents 31e81c1 + 9d01d27 commit 7c413f0

File tree

3 files changed

+27
-61
lines changed

3 files changed

+27
-61
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
},
5858
"extra": {
5959
"branch-alias": {
60-
"dev-main": "2.6.x-dev"
60+
"dev-main": "2.8.x-dev"
6161
}
6262
},
6363
"autoload-dev": {

composer.lock

Lines changed: 20 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

features/requests.feature

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -56,37 +56,21 @@ Feature: Requests integration with both v1 and v2
5656
When I run `wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
5757
Then STDOUT should contain:
5858
"""
59-
object(WpOrg\Requests\Response)
60-
"""
61-
And STDOUT should contain:
62-
"""
63-
HTTP/1.1 200 OK
64-
"""
65-
And STDERR should be empty
66-
67-
When I run `wp eval 'var_dump( \WpOrg\Requests\Requests::get( "https://example.com/" ) );'`
68-
Then STDOUT should contain:
69-
"""
70-
object(WpOrg\Requests\Response)
59+
object(Requests_Response)
7160
"""
7261
And STDOUT should contain:
7362
"""
7463
HTTP/1.1 200 OK
7564
"""
7665
And STDERR should be empty
7766

78-
When I run `wp eval 'var_dump( \Requests::get( "https://example.com/" ) );'`
67+
When I run `wp plugin install duplicate-post`
7968
Then STDOUT should contain:
8069
"""
81-
object(WpOrg\Requests\Response)
70+
Success: Installed 1 of 1 plugins.
8271
"""
83-
And STDOUT should contain:
84-
"""
85-
HTTP/1.1 200 OK
86-
"""
87-
And STDERR should be empty
8872

89-
Scenario: Current version with WordPress-bundled Requests v2
73+
Scenario: Current version with WordPress-bundled Requests v2
9074
Given a WP installation
9175
And I run `wp core update --version=6.2 --force`
9276

@@ -107,28 +91,8 @@ Feature: Requests integration with both v1 and v2
10791
"""
10892
And STDERR should be empty
10993

110-
When I run `wp eval 'var_dump( \WpOrg\Requests\Requests::get( "https://example.com/" ) );'`
94+
When I run `wp plugin install duplicate-post`
11195
Then STDOUT should contain:
11296
"""
113-
object(WpOrg\Requests\Response)
114-
"""
115-
And STDOUT should contain:
116-
"""
117-
HTTP/1.1 200 OK
118-
"""
119-
And STDERR should be empty
120-
121-
# Expect a deprecation warning here.
122-
When I try `wp eval 'var_dump( \Requests::get( "https://example.com/" ) );'`
123-
Then STDOUT should contain:
124-
"""
125-
object(WpOrg\Requests\Response)
126-
"""
127-
And STDOUT should contain:
128-
"""
129-
HTTP/1.1 200 OK
130-
"""
131-
And STDERR should contain:
132-
"""
133-
The PSR-0 `Requests_...` class names in the Requests library are deprecated.
97+
Success: Installed 1 of 1 plugins.
13498
"""

0 commit comments

Comments
 (0)