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
I'm trying to test some HTTP requests generated by WordPress HTTP functions, such as wp_remote_post and wp_remote_get.
PHP-VCR is able to successfully record the HTTP request using the curl library hook and store it in either YAML or JSON format. However, the HTTP request throws an error on the application code, no matter how many times I try to run the test:
I'm using PHP-VCR version 1.4.5 installed through Composer. Unfortunately, I couldn't test it with PHP-VCR version 1.5.0 (latest version) because of the issue reported in #328.
I'm running tests in this Docker container, which is based on the php-unit/php-unit:6.0.6 image. If you look at the Dockerfile, you can see this image has PHP 7 installed through Alpine and all necessary dependencies, including curl and php7-curl.
The text was updated successfully, but these errors were encountered:
felipead
changed the title
PHP-VCR does not work with wp_remote_post and wp_remote_get from WordPress
"Missing header/body separator" error with wp_remote_post and wp_remote_get from WordPress
Aug 19, 2020
I'm trying to test some HTTP requests generated by WordPress HTTP functions, such as
wp_remote_post
andwp_remote_get
.PHP-VCR is able to successfully record the HTTP request using the
curl
library hook and store it in either YAML or JSON format. However, the HTTP request throws an error on the application code, no matter how many times I try to run the test:The error goes away if I disable PHP-VCR.
I have tested it with endpoints from Google, Facebook, and other sites. It does not seem related to any particular website.
Google search was not very helpful. However, the same error message appeared in #115, which appears to have been fixed a long time ago.
Example
Here is the cassette recorded:
Here is the test output:
Environment
I'm running WordPress 5.2.4 and PHP 7.
I'm using PHP-VCR version 1.4.5 installed through Composer. Unfortunately, I couldn't test it with PHP-VCR version 1.5.0 (latest version) because of the issue reported in #328.
I'm running tests in this Docker container, which is based on the
php-unit/php-unit:6.0.6
image. If you look at the Dockerfile, you can see this image has PHP 7 installed through Alpine and all necessary dependencies, includingcurl
andphp7-curl
.The text was updated successfully, but these errors were encountered: