You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: features/requests.feature
+133Lines changed: 133 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -96,3 +96,136 @@ Feature: Requests integration with both v1 and v2
96
96
"""
97
97
Success: Installed 1 of 1 plugins.
98
98
"""
99
+
100
+
Scenario: Composer stack with Requests v1 pulling wp-cli/wp-cli-bundle
101
+
Given an empty directory
102
+
And a composer.json file:
103
+
"""
104
+
{
105
+
"name": "example/wordpress",
106
+
"type": "project",
107
+
"extra": {
108
+
"wordpress-install-dir": "wp",
109
+
"installer-paths": {
110
+
"content/plugins/{$name}/": [
111
+
"type:wordpress-plugin"
112
+
],
113
+
"content/themes/{$name}/": [
114
+
"type:wordpress-theme"
115
+
]
116
+
}
117
+
},
118
+
"repositories": [
119
+
{
120
+
"type": "composer",
121
+
"url": "https://wpackagist.org"
122
+
}
123
+
],
124
+
"require": {
125
+
"johnpbloch/wordpress": "6.1"
126
+
},
127
+
"require-dev": {
128
+
"wp-cli/wp-cli-bundle": "dev-main as 2.8.1"
129
+
},
130
+
"minimum-stability": "dev",
131
+
"config": {
132
+
"allow-plugins": {
133
+
"johnpbloch/wordpress-core-installer": true
134
+
}
135
+
}
136
+
}
137
+
"""
138
+
# Note: Composer outputs messages to stderr.
139
+
And I run `composer install --no-interaction 2>&1`
140
+
And a wp-cli.yml file:
141
+
"""
142
+
path: wp
143
+
"""
144
+
And an extra-config.php file:
145
+
"""
146
+
require __DIR__ . "/../vendor/autoload.php";
147
+
"""
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
150
+
151
+
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`
152
+
Then STDOUT should be:
153
+
"""
154
+
Success: Generated 'wp-config.php' file.
155
+
"""
156
+
157
+
When I run `vendor/bin/wp config set WP_DEBUG true --raw`
158
+
Then STDOUT should be:
159
+
"""
160
+
Success: Updated the constant 'WP_DEBUG' in the 'wp-config.php' file with the raw value 'true'.
161
+
"""
162
+
163
+
When I run `vendor/bin/wp config set WP_DEBUG_DISPLAY true --raw`
164
+
Then STDOUT should be:
165
+
"""
166
+
Success: Added the constant 'WP_DEBUG_DISPLAY' to the 'wp-config.php' file with the raw value 'true'.
167
+
"""
168
+
169
+
When I run `vendor/bin/wp db create`
170
+
Then STDOUT should be:
171
+
"""
172
+
Success: Database created.
173
+
"""
174
+
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]`
177
+
Then STDOUT should contain:
178
+
"""
179
+
Success: WordPress installed successfully.
180
+
"""
181
+
182
+
When I run `vendor/bin/wp core version`
183
+
Then STDOUT should contain:
184
+
"""
185
+
6.1
186
+
"""
187
+
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/" ) );'`
190
+
Then STDOUT should contain:
191
+
"""
192
+
object(Requests_Response)
193
+
"""
194
+
And STDOUT should contain:
195
+
"""
196
+
HTTP/1.1 200 OK
197
+
"""
198
+
199
+
# This can throw deprecated warnings on PHP 8.1+.
200
+
When I try `vendor/bin/wp plugin install duplicate-post --activate`
201
+
Then STDOUT should contain:
202
+
"""
203
+
Success: Installed 1 of 1 plugins.
204
+
"""
205
+
206
+
And I launch in the background `wp server --host=localhost --port=8181`
207
+
And I run `wp option set blogdescription 'Just another Composer-based WordPress site'`
208
+
209
+
When I run `curl -sS localhost:8181`
210
+
Then STDOUT should contain:
211
+
"""
212
+
Just another Composer-based WordPress site
213
+
"""
214
+
215
+
When I run `vendor/bin/wp eval 'echo COOKIEHASH;'`
216
+
And save STDOUT as {COOKIEHASH}
217
+
Then STDOUT should not be empty
218
+
219
+
When I run `vendor/bin/wp eval 'echo wp_generate_auth_cookie( 1, 32503680000 );'`
220
+
And save STDOUT as {AUTH_COOKIE}
221
+
Then STDOUT should not be empty
222
+
223
+
When I run `curl -b 'wordpress_{COOKIEHASH}={AUTH_COOKIE}' -sS localhost:8181/wp-admin/plugins.php`
0 commit comments