Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"require-dev": {
"roave/security-advisories": "dev-latest",
"wp-cli/package-command": "^2.1",
"wp-cli/wp-cli-tests": "^5"
"wp-cli/wp-cli-tests": "dev-try/windows-logging"
},
"suggest": {
"psy/psysh": "Enhanced `wp shell` functionality",
Expand Down
15 changes: 8 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions features/command.feature
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ Feature: WP-CLI Commands
honked
"""
# No trailing spaces on Windows.
@skip-windows
Scenario: Register a longdesc for a given command
Given an empty directory
And a custom-cmd.php file:
Expand Down
32 changes: 26 additions & 6 deletions features/requests.feature
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ Feature: Requests integration with both v1 and v2
5.8
"""

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

When I run `wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
Given a check-request-v1.php file:
"""
<?php
var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );
"""
When I run `wp eval-file check-request-v1.php`
Then STDOUT should contain:
"""
object(Requests_Response)
Expand Down Expand Up @@ -91,7 +101,12 @@ Feature: Requests integration with both v1 and v2
6.2
"""

When I run `wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
Given a check-request-v2.php file:
"""
<?php
var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );
"""
When I run `wp eval-file check-request-v2.php`
Then STDOUT should contain:
"""
object(WpOrg\Requests\Response)
Expand Down Expand Up @@ -200,7 +215,12 @@ Feature: Requests integration with both v1 and v2
"""

# This can throw deprecated warnings on PHP 8.1+.
When I try `vendor/bin/wp eval 'var_dump( \WP_CLI\Utils\http_request( "GET", "https://example.com/" ) );'`
Given a check-request-v2-phar.php file:
"""
<?php
var_dump( \WP_CLI\Utils\http_request( 'GET', 'https://example.com/' ) );
"""
When I try `vendor/bin/wp eval-file check-request-v2-phar.php`
Then STDOUT should contain:
"""
object(Requests_Response)
Expand All @@ -227,11 +247,11 @@ Feature: Requests integration with both v1 and v2
Just another Composer-based WordPress site
"""

When I run `vendor/bin/wp eval 'echo COOKIEHASH;'`
When I run `vendor/bin/wp eval "echo COOKIEHASH;"`
And save STDOUT as {COOKIEHASH}
Then STDOUT should not be empty

When I run `vendor/bin/wp eval 'echo wp_generate_auth_cookie( 1, 32503680000 );'`
When I run `vendor/bin/wp eval "echo wp_generate_auth_cookie( 1, 32503680000 );"`
And save STDOUT as {AUTH_COOKIE}
Then STDOUT should not be empty

Expand Down
Loading