Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

Overview

PHP-VCR

Build Status Code Coverage Scrutinizer Quality Score

This is a port of the VCR Ruby library to PHP.

Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests. A bit of documentation can be found on the php-vcr website.

Disclaimer: Doing this in PHP is not as easy as in programming languages which support monkey patching (I'm looking at you, Ruby)

Features

  • Automatically records and replays your HTTP(s) interactions with minimal setup/configuration code.
  • Supports common http functions and extensions
    • everything using streamWrapper: fopen(), fread(), file_get_contents(), ... without any modification (except $http_response_header see #96)
    • SoapClient by adding \VCR\VCR::turnOn(); in your tests/bootstrap.php
    • curl(), by adding \VCR\VCR::turnOn(); in your tests/bootstrap.php
  • The same request can receive different responses in different tests -- just use different cassettes.
  • Disables all HTTP requests that you don't explicitly allow by setting the record mode
  • Request matching is configurable based on HTTP method, URI, host, path, body and headers, or you can easily implement a custom request matcher to handle any need.
  • The recorded requests and responses are stored on disk in a serialization format of your choice (currently YAML and JSON are built in, and you can easily implement your own custom serializer)
  • Supports PHPUnit annotations.

Usage example

Using static method calls:

class VCRTest extends TestCase
{
    public function testShouldInterceptStreamWrapper()
    {
        // After turning on the VCR will intercept all requests
        \VCR\VCR::turnOn();

        // Record requests and responses in cassette file 'example'
        \VCR\VCR::insertCassette('example');

        // Following request will be recorded once and replayed in future test runs
        $result = file_get_contents('http://example.com');
        $this->assertNotEmpty($result);

        // To stop recording requests, eject the cassette
        \VCR\VCR::eject();

        // Turn off VCR to stop intercepting requests
        \VCR\VCR::turnOff();
    }

    public function testShouldThrowExceptionIfNoCasettePresent()
    {
        $this->setExpectedException(
            'BadMethodCallException',
            "Invalid http request. No cassette inserted. Please make sure to insert "
            . "a cassette in your unit test using VCR::insertCassette('name');"
        );
        \VCR\VCR::turnOn();
        // If there is no cassette inserted, a request throws an exception
        file_get_contents('http://example.com');
    }
}

You can use annotations in PHPUnit by using phpunit-testlistener-vcr:

class VCRTest extends TestCase
{
    /**
     * @vcr unittest_annotation_test
     */
    public function testInterceptsWithAnnotations()
    {
        // Requests are intercepted and stored into  tests/fixtures/unittest_annotation_test.
        $result = file_get_contents('http://google.com');

        $this->assertEquals('This is a annotation test dummy.', $result, 'Call was not intercepted (using annotations).');

        // VCR is automatically turned on and off.
    }
}

Installation

Simply run the following command:

$ composer require --dev php-vcr/php-vcr

Dependencies

PHP-VCR depends on:

Composer installs all dependencies except extensions like curl.

Run tests

In order to run all tests you need to get development dependencies using composer:

composer install
composer test

Changelog

The changelog has moved to the PHP-VCR releases page.

Old changelog entries

Copyright

Copyright (c) 2013-2016 Adrian Philipp. Released under the terms of the MIT license. See LICENSE for details. Contributors

Comments
  • PHP7.4 & guzzle

    PHP7.4 & guzzle

    Since upgrading to php7.4 im getting

    ParseError : syntax error, unexpected end of file, expecting :: (T_PAAMAYIM_NEKUDOTAYIM)
     vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:197
    

    I have noticed this on multiple projects. I'll try to look into this later today, but as of now it's not really usable on php 7.4.

    I only get this error when VCR is turned on.

    Bug 
    opened by janvernieuwe 24
  • Fix POST requests

    Fix POST requests

    Here are failing test cases for #120. The tests seem to be exhibiting a different, though perhaps related, problem than what I was seeing. I'll have to debug further to figure out what's going wrong. Any ideas?

    opened by justincy 23
  • Guzzle v3 causing issues with other packages requiring Guzzle v4

    Guzzle v3 causing issues with other packages requiring Guzzle v4

    I'm trying to use VCR with another package which uses "guzzlehttp/guzzle": "4.2.2" but because VCR is using "guzzle/http": "3.*" I'm getting an error:

    To set a CURLOPT_READFUNCTION, CURLOPT_INFILESIZE must be set.
    

    I've spoken to the maintainer of the other package, omniphx/forrest, in some depth about it in issue 17 on his repository and full details of the errors we've managed to reproduce are available there.

    Do you have any plans to upgrade to Guzzle 4 or 5, or is there a workaround you could suggest to solve the issue we're having?

    Thanks

    opened by Harrisonbro 21
  • php-vcr unit test fail on Windows 7

    php-vcr unit test fail on Windows 7

    Trying to run unit test on latest master branch fails. Could it be that PHP-VCR is overwriting its own class?

    On windows 7, with PHP 5.6 RC3

    Khalifah@KHALIFAH-PC /e/Khalifah/Projects/php-vcr (master)
    $ phpunit
    PHPUnit 3.7.37 by Sebastian Bergmann.
    
    Configuration read from E:\Khalifah\Projects\php-vcr\phpunit.xml
    
    ...............................................................  63 / 198 ( 31%)
    ...............
    Fatal error: Class 'VCR\Util\SoapClient' not found in E:\Khalifah\Projects\php-vcr\src\VCR\Util\SoapClient.php on line 12
    
    Call Stack:
        0.0000     124248   1. {main}() C:\Users\Khalifah\vendor\phpunit\phpunit\phpunit:0
        0.0040     326056   2. PHPUnit_TextUI_Command::main() C:\Users\Khalifah\vendor\phpunit\phpunit\phpunit:54
        0.0040     326384   3. PHPUnit_TextUI_Command->run() C:\Users\Khalifah\vendor\phpunit\phpunit\src\TextUI\Command.php:138
        0.7470    3746792   4. PHPUnit_TextUI_TestRunner->doRun() C:\Users\Khalifah\vendor\phpunit\phpunit\src\TextUI\Command.php:186
        0.8020    3926400   5. PHPUnit_Framework_TestSuite->run() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\TextUI\TestRunner.php:350
        1.7681    6218960   6. PHPUnit_Framework_TestSuite->run() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:709
        1.7681    6219440   7. PHPUnit_Framework_TestSuite->runTest() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:
    749
        1.7681    6219792   8. PHPUnit_Framework_TestCase->run() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestSuite.php:779
        1.7691    6220040   9. PHPUnit_Framework_TestResult->run() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:783
        1.7691    6221264  10. PHPUnit_Framework_TestCase->runBare() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestResult.php:
    648
        1.7691    6255192  11. PHPUnit_Framework_TestCase->runTest() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:83
    8
        1.7691    6255720  12. ReflectionMethod->invokeArgs() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:988
        1.7691    6255856  13. VCR\LibraryHooks\SoapHookTest->testShouldInterceptCallWhenEnabled() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHP
    Unit\Framework\TestCase.php:988
        1.7701    6256616  14. spl_autoload_call() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.php:34
        1.7701    6256648  15. Composer\Autoload\ClassLoader->loadClass() E:\Khalifah\Projects\php-vcr\vendor\phpunit\phpunit\PHPUnit\Framework\TestCase.p
    hp:0
        1.7701    6256984  16. Composer\Autoload\includeFile() C:\Users\Khalifah\vendor\composer\ClassLoader.php:274
        1.7731    6265192  17. include('E:\Khalifah\Projects\php-vcr\src\VCR\Util\SoapClient.php') C:\Users\Khalifah\vendor\composer\ClassLoader.php:382
    
    Bug 
    opened by b01 16
  • Fail running test

    Fail running test

    Hi I'm running php-vcr tests with Guzzle 3.7.

    And I get the error PHP Fatal error: Cannot use object of type Guzzle\Http\Message\Header as array in /opt/app/framework/vendor/adri/php-vcr/src/VCR/Response.php on line 33

    When the test testShouldInterceptStreamWrapper() is runned.

    Then I modified the line https://github.com/adri/php-vcr/blob/master/src/VCR/Response.php#L32 for something like

                $value=$value->toArray();
                $headers[$key] = $value[0];
    

    after the change I get Segmentation fault (core dumped)

    Let me know if you have any ideas how to solve this.

    opened by edwin-bluekite 15
  • CurlHelper::handleOutput() must be an instance of VCR\Response, null given

    CurlHelper::handleOutput() must be an instance of VCR\Response, null given

    I'm getting this error while trying to use vcr and I can't find the solution to the problem:

    1) DataFetcherTest::test_fetch_should_return_from_api
    Argument 1 passed to VCR\Util\CurlHelper::handleOutput() must be an instance of
    VCR\Response, null given, called in G:\PHP\EveFetcher\workbench\beijer\eve-fetch
    er\vendor\php-vcr\php-vcr\src\VCR\LibraryHooks\CurlHook.php on line 193 and defi
    ned
    
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\php-vcr\php-vcr\src\VCR\Ut
    il\CurlHelper.php:52
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\php-vcr\php-vcr\src\VCR\Li
    braryHooks\CurlHook.php:193
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\php-vcr\php-vcr\src\VCR\Li
    braryHooks\CurlHook.php:245
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\php-vcr\php-vcr\src\VCR\Li
    braryHooks\CurlHook.php:150
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\guzzle\guzzle\src\Guzzle\H
    ttp\Curl\CurlMulti.php:225
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\guzzle\guzzle\src\Guzzle\H
    ttp\Curl\CurlMulti.php:225
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\guzzle\guzzle\src\Guzzle\H
    ttp\Curl\CurlMulti.php:211
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\guzzle\guzzle\src\Guzzle\H
    ttp\Curl\CurlMulti.php:105
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\guzzle\guzzle\src\Guzzle\H
    ttp\Curl\CurlMultiProxy.php:91
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\guzzle\guzzle\src\Guzzle\H
    ttp\Client.php:282
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\vendor\guzzle\guzzle\src\Guzzle\H
    ttp\Message\Request.php:198
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\src\Beijer\EveFetcher\Core\DataFe
    tcher.php:45
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\src\Beijer\EveFetcher\Core\DataFe
    tcher.php:28
    G:\PHP\EveFetcher\workbench\beijer\eve-fetcher\tests\DataFetcherTest.php:16
    

    The fixture is getting the info it should recieve:

    -
        request:
            method: GET
            url: 'https://api.eveonline.com/server/ServerStatus.xml.aspx'
            headers:
                host: api.eveonline.com
                user-agent: 'Guzzle/3.8.1 curl/7.30.0 PHP/5.5.2'
                content-length: 0
        response:
            status: 200
            headers:
                Transfer-Encoding: chunked
                Content-Type: 'application/xml; charset=utf-8'
                Date: 'Sun, 06 Apr 2014 15:42:06 GMT'
            body: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n  <currentTime>2014-04-06 15:42:07</currentTime>\r\n  <result>\r\n    <serverOpen>True</serverOpen>\r\n    <onlinePlayers>40065</onlinePlayers>\r\n  </result>\r\n  <cachedUntil>2014-04-06 15:42:19</cachedUntil>\r\n</eveapi>"
    -
        request:
            method: GET
            url: 'https://api.eveonline.com/server/ServerStatus.xml.aspx'
            headers:
                host: api.eveonline.com
                user-agent: 'Guzzle/3.8.1 curl/7.30.0 PHP/5.5.2'
                content-length: 0
        response:
            status: 200
            headers:
                Transfer-Encoding: chunked
                Content-Type: 'application/xml; charset=utf-8'
                Date: 'Sun, 06 Apr 2014 15:42:20 GMT'
            body: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n  <currentTime>2014-04-06 15:42:20</currentTime>\r\n  <result>\r\n    <serverOpen>True</serverOpen>\r\n    <onlinePlayers>40171</onlinePlayers>\r\n  </result>\r\n  <cachedUntil>2014-04-06 15:45:19</cachedUntil>\r\n</eveapi>"
    
    opened by beijer 14
  • Revamp PHP-VCR

    Revamp PHP-VCR

    Alright, after a while PHP-VCR is back in the game 💪🏻

    As we have new maintainers, the goal is to revamp and modernize this project in its version 2.0 🎉

    We'll take a look into the open PRs and get familiar with the codebase so we can start to merge and improve some stuff 🛠

    Main ideas for now 💡

    • Require minimum PHP 7.2 (as proposed in #259 by @moufmouf)
    • Require Symfony 5 (as proposed in #287 by @Jeroeny)
    • Introduce a Static Analysis tool (as proposed in #257 by @moufmouf)
    • Make usage of a Makefile instead of Composer scripts

    After that, we can start to take a look into bug fixes and new features ☺️

    opened by carusogabriel 13
  • Throw VCRException when cURL request fails

    Throw VCRException when cURL request fails

    Prior to this change, a cURL failure in which curl_exec() returns false, was resulting in a less than helpful "Undefined offset: 1" exception being thrown from the explode() call in HttpUtil.parseResponse()

    This change throws a VCRException with the underlying curl error and error number, making debugging that much easier

    opened by justinstern 13
  • Dispatch before playback event for each http interaction in cassette

    Dispatch before playback event for each http interaction in cassette

    Fix for #101.

    As I mention in this comment, I followed Ruby VCR's lead (and aaa2000's suggestion) and dispatch the "before playback" event before each HTTP interaction in the cassette.

    I did not do change the 'after playback' event, since there should be one anyway.

    I did end up moving the dispatch into the configuration, a la Ruby's VCR. This means the dispatch method needs to be public.

    opened by tylercollier 13
  • call_user_func doesn't work in this context with private or protected…

    call_user_func doesn't work in this context with private or protected…

    Context

    Calling call_user_func in CurlHelper.php doesn't work when CURLOPT_HEADERFUNCTION or CURLOPT_WRITEFUNCTION have been set with private or protected methods. This has caused issues when using php-vcr with PayPal's PHP SDK (https://github.com/paypal/PayPal-PHP-SDK/issues/1057).

    What has been done

    • I've added a wrapper function around call_user_func that attempts to detect when this scenario is encountered and then works around it using some reflection magic.

    How to test

    • Unit tests have been added, so it can be tested in the usual way.
    opened by alnorth 12
  • New PHP 7, fully type-hinted version

    New PHP 7, fully type-hinted version

    Context

    As proposed in #256 , here is a complete PR to modernize PHP-VCR.

    What has been done

    • Made PHP 7.2 the minimum version
    • Merged a few pending PRs (#258 and #210)
    • Upgraded to PHPunit 7.
    • Removed the lapistano/proxy-object library.
    • Fixed all PHPStan declared errors up to the maximum level (level 7)
    • Added PHP 7.1 type-hints absolutely everywhere (thanks to thecodingmachine/phpstan-strict-rules that detects missing type hints).

    I worked on my fork. You can have a look at the various PRs I did on my own fork here:

    • https://github.com/moufmouf/php-vcr/pull/1
    • https://github.com/moufmouf/php-vcr/pull/3
    • https://github.com/moufmouf/php-vcr/pull/4
    • https://github.com/moufmouf/php-vcr/pull/5

    I tried to keep the commits as atomic as possible. I added a few unit tests and I also remove a few unit tests that were useless because they were checking for types (and the type hint does that automatically now).

    We must still decide if we want to target a 1.5 or a 2.0 version with this PR. If we go for the 2.0, I have a few ideas that are clearly breaking changes. For instance, it would be safer to declare a "RequestMatcherInterface" that matches 2 requests (so far, a request matcher is a simple callable that cannot by type hinted).

    Note: all the tests are passing but I will test this PR properly on a real-life project next week. Meanwhile, let's keep the [WIP] flag for safety :)

    About the removal of lapistano/proxy-object:

    It was used to access protected properties of objects and was abandonned (project did not move in 3 years), and incompatible with PHPUnit 7. I replaced it with simple anonymous classes that extend the object that was previously proxied and that have an extra public getter on the protected properties/methods I want to access. So I replaced a complete library with a simple new language feature added in PHP 7 (anonymous classes). PHP7 FTW!

    opened by moufmouf 12
  • Add CURLINFO_APPCONNECT_TIME to CurlHelper

    Add CURLINFO_APPCONNECT_TIME to CurlHelper

    Fixes #309

    Context

    Using with the Laravel HTTP client in tests, I was receiving the error ErrorException: Undefined offset: 3145761 and also BadMethodCallException: Not implemented: CURLINFO_APPCONNECT_TIME (3145761)

    What has been done

    • Added CURLINFO_APPCONNECT_TIME to CurlHelper $curlInfoList array
    • Added CURLINFO_APPCONNECT_TIME case to switch in CurlHelper::getCurlOptionFromResponse

    How to test

    • Use the unmodified release with the laravel HTTP client, see error
    • Use this branch with the laravel HTTP client, error should be resolved
    Bug Status: Needs review 
    opened by oranges13 0
  • Running the test suites will be failed with PHP 8.2 version

    Running the test suites will be failed with PHP 8.2 version

    As title, it seems that the test suites will be failed with PHP 8.2 version. Here are steps to reproduce:

    • Installing the PHP 8.2 version.
    • Cloning the the php-vcr repository. And I ensure latest stable version also has this issue.
    • Installing the dependencies via the composer install command.
    • And run the vendor/bin/phpunit command.

    Some outputs are as follows:

    $ php -v
    PHP 8.2.0 (cli) (built: Dec 10 2022 10:52:23) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.2.0, Copyright (c) Zend Technologies
        with Zend OPcache v8.2.0, Copyright (c), by Zend Technologies
    $ git clone https://github.com/php-vcr/php-vcr
    Cloning into 'php-vcr'...
    remote: Enumerating objects: 5803, done.
    remote: Counting objects: 100% (682/682), done.
    remote: Compressing objects: 100% (281/281), done.
    remote: Total 5803 (delta 377), reused 619 (delta 347), pack-reused 5121
    Receiving objects: 100% (5803/5803), 1.10 MiB | 6.29 MiB/s, done.
    Resolving deltas: 100% (3235/3235), done.
    $ cd php-vcr/
    $ php ~/composer.phar update
    Loading composer repositories with package information
    Info from https://repo.packagist.org: #StandWithUkraine
    Updating dependencies
    Lock file operations: 71 installs, 0 updates, 0 removals
      - Locking beberlei/assert (v3.3.2)
    ........
    $ vendor/bin/phpunit
    Segmentation fault (core dumped)
    
    Bug WIP 
    opened by peter279k 5
  • Pass url into curlinfo hook for effective url

    Pass url into curlinfo hook for effective url

    Context

    Issue #363

    When checking for errors in a curl_multi I pull the effective url to log with the error.

    $url = curl_getinfo($curl_handles[$x], CURLINFO_EFFECTIVE_URL);
    

    Which currently fails with php-vcr

    BadMethodCallException: Not implemented: CURLINFO_EFFECTIVE_URL (1048577)
    

    IMHO it really should just return the request url parameter from the source YAML.

    What has been done

    • Added a nullable string parameter to the getCurlOptionFromResponse to pass in the URL (or null)
    • Get the url from the self::$requests array of VCR\Request objects

    How to test

    • Before if you did a command like above you get the above error.
    • Now you should get the url provided in the request -> url parameter

    Todo

    • [ ]
    • [ ]

    Notes

    • I'm very new to php-vcr, so this might go against the pattern you are trying to work to. If so any guidance would be appreciated.
    opened by whikloj 2
  • BadMethodCallException: Not implemented: CURLINFO_EFFECTIVE_URL (1048577)

    BadMethodCallException: Not implemented: CURLINFO_EFFECTIVE_URL (1048577)

    In a curl multihandle I use this curlinfo option to get the current handle's URL. It appears relatively easy to fix, but I'm also very new to php-vcr.

    opened by whikloj 0
  • Update HttpUtil responseParsing to handle multiple HTTP responses

    Update HttpUtil responseParsing to handle multiple HTTP responses

    Context

    Within our projects we use a proxy when connecting to some services, and when doing this we get an extra HTTP/... in the response string that is then parsed. Similar to the 100 continue issue, but ours were 200 OK response from the proxy added ontop

    What has been done

    • the HttpUtil parsing of response has been update to only get the headers after the last HTTP/ line, which ideally should make this much more flexible than just stripping any 100 continues
    • test added to make sure cases other than 100 continue are treated correctly

    How to test

    • If possible use a proxy that adds a response (ideally not 100 continue)
    • check the automated test that was added
    opened by sf-cg 1
Releases(1.6.4)
  • 1.6.4(Dec 27, 2022)

    What's Changed

    • Support for Symfony 6 by @nicodemuz in https://github.com/php-vcr/php-vcr/pull/361
    • FIX: Read the whole stream and perform code transformations by @higidi in https://github.com/php-vcr/php-vcr/pull/382

    New Contributors

    • @nicodemuz made their first contribution in https://github.com/php-vcr/php-vcr/pull/361

    Full Changelog: https://github.com/php-vcr/php-vcr/compare/1.6.3...1.6.4

    Source code(tar.gz)
    Source code(zip)
  • 1.5.5(Dec 27, 2022)

    What's Changed

    • FIX: Read the whole stream and perform code transformations by @higidi in https://github.com/php-vcr/php-vcr/pull/384

    Full Changelog: https://github.com/php-vcr/php-vcr/compare/1.5.4...1.5.5

    Source code(tar.gz)
    Source code(zip)
  • 1.6.3(Dec 19, 2022)

  • 1.5.4(Dec 19, 2022)

  • 1.5.3(Dec 19, 2022)

  • 1.6.2(Dec 15, 2022)

  • 1.6.1(Dec 15, 2022)

  • 1.5.2(Mar 20, 2021)

    • Added support for curl_multi_getcontent https://github.com/php-vcr/php-vcr/pull/339 (by @Khartir)
    • Added support for CURLPROXY_HTTPS https://github.com/php-vcr/php-vcr/pull/334 (by @specialtactics)
    • Various internal improvements
    Source code(tar.gz)
    Source code(zip)
  • 1.5.1(Nov 22, 2020)

    • Fixed current master (https://github.com/php-vcr/php-vcr/pull/333 by @pvgnd)
    • No longer track composer.lock (https://github.com/php-vcr/php-vcr/pull/331 by @pvgnd)
    • Fixed problems with private and protected methods used with CURLOPT_HEADERFUNCTION or CURLOPT_WRITEFUNCTION (https://github.com/php-vcr/php-vcr/pull/260 by @alnorth)
    Source code(tar.gz)
    Source code(zip)
  • 1.5.0(Jul 28, 2020)

    • By far the most amount of work was done by @moufmouf . His PR #259 was merged, introducing type-hinting and phpstan. As a result of this, support for PHP <= 7.1 was dropped.
    • Support for Symfony 5 was added by @pauladams8 in #311
    • Various minor cleanup jobs
    Source code(tar.gz)
    Source code(zip)
  • 1.5.0alpha1(Jul 1, 2020)

  • 1.5.0alpha0(Jun 25, 2020)

  • 1.4.5(Jun 3, 2020)

    It has been a while since the last release. This release is nothing major: just some minor tweaks and fixes that have been done since the last release. Possibly, this is the last release on the 1.4.* series.

    Source code(tar.gz)
    Source code(zip)
  • 1.4.4(May 30, 2018)

  • 1.4.3(May 30, 2018)

    • #237 Refactoring tests @carusogabriel
    • #245 Fix calls to /dev/urandom @alnorth
    • #246 Add tests for Guzzle 6 @moufmouf
    • #247 Fix broken integration tests @moufmouf
    Source code(tar.gz)
    Source code(zip)
  • 1.4.2(Dec 8, 2017)

  • 1.4.1(Oct 18, 2017)

  • 1.4.0(Oct 18, 2017)

    • #219 PHP-VCR 1.4 minor cycle
    • #192 / #220 CurlHook now returns integer HTTP status codes
    • #212 StreamProcessor now checks for file existence when mode is read only
    Source code(tar.gz)
    Source code(zip)
  • 1.3.4(Oct 18, 2017)

  • 1.3.3(Oct 18, 2017)

    • #216 Prevent first header from being lost when combining arrays
    • #186 / #187 Always override request method if CURLOPT_CUSTOMREQUEST is set
    Source code(tar.gz)
    Source code(zip)
  • 1.3.2(Dec 23, 2016)

    • [x] #175 Set POST method when CURLOPT_POSTFIELDS is set
    • [x] #151 Fix parallel Curl requests
    • [x] #158 / #185 Fix bug with StreamProcessor::stream_lock
    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Oct 26, 2016)

    #147 Reset request on curl_reset #170 Removed test for non implemented feature and bumped phpunit #171 Fixes #153 and #152: SoapClient::__getLastRequest() returns NULL in PHP 5.3 and 5.4

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Oct 19, 2016)

    We are bumping minor instead of patch versions because of small breaks, like symfony event version and the way to handle headers.

    #166 Improve versions constraints to better compatibility #163 Fix for parsing header values that include colons followed by spaces #164 Documentation and hide old changelogs #165 Fixed SOAP tests by replacing the public weather API

    Source code(tar.gz)
    Source code(zip)
  • 1.2.8(Jan 27, 2016)

  • 1.2.7(Jan 7, 2016)

    #137 Honor silent flag & prevent error handler catch, thanks to @mdarse #144 provide more information when not in recording mode, thanks to @dbu

    Source code(tar.gz)
    Source code(zip)
  • 1.2.6(Sep 29, 2015)

    Thanks to all involved!

    #141 Adds SOAPAction header for SOAP 1.1 #140 Uses correct header for SOAP 1.1 #139 Fixes paths on windows #124 Parse duplicate headers #127 Fixes before and after events #128 HTTP continue header

    Source code(tar.gz)
    Source code(zip)
  • 1.2.5(Jun 19, 2015)

  • 1.2.4(Mar 2, 2015)

  • 1.2.3(Feb 24, 2015)

Owner
php-vcr
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
php-vcr
Declarative HTTP Clients using Guzzle HTTP Library and PHP 8 Attributes

Waffler How to install? $ composer require waffler/waffler This package requires PHP 8 or above. How to test? $ composer phpunit Quick start For our e

Waffler 3 Aug 26, 2022
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

null 3.5k Dec 31, 2022
Requests for PHP is a humble HTTP request library. It simplifies how you interact with other sites and takes away all your worries.

Requests for PHP Requests is a HTTP library written in PHP, for human beings. It is roughly based on the API from the excellent Requests Python librar

null 3.5k Dec 31, 2022
This package provides the database factory experience to fake Http calls in your testsuite.

This package provides the database factory experience to fake Http calls in your testsuite

DIJ 11 May 2, 2022
Opsie Operator is a CLI to check your website for HTTP downtime.

Opsie Operator Monitor any website. Run in Docker or any Kubernetes cluster. Send webhooks. ?? Supporting If you are using one or more Renoki Co. open

opsie 14 Dec 6, 2021
Just HTTP Status Codes is a great way to empower your project with clean practice 💫

The Simplest & Cleanest HTTP Status Codes for PHP. All PHP HTTP Status Codes are stored into beautiful constant names ?? Ideal when you develop an API that involves various HTTP codes ??

♚ PH⑦ de Soria™♛ 10 Dec 18, 2022
Spike is a fast reverse proxy built on top of ReactPHP that helps to expose your local services to the internet.

Spike is a fast reverse proxy built on top of ReactPHP that helps to expose your local services to the internet. 简体中文 Installation Install via compose

Tao 649 Dec 26, 2022
PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs

PHP Curl Class: HTTP requests made easy PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. Installation Requirements Quic

null 3.1k Jan 5, 2023
Application for logging HTTP and DNS Requests

Request Logger Made by Adam Langley ( https://twitter.com/adamtlangley ) What is it? Request logger is a free and open source utility for logging HTTP

null 13 Nov 28, 2022
librestful is a virion for PocketMine servers that make easier, readable code and for async http requests.

librestful is a virion for PocketMine servers that make easier, readable code for async rest requests.

RedMC Network 17 Oct 31, 2022
A simple PHP Toolkit to parallel generate combinations, save and use the generated terms to brute force attack via the http protocol.

Brutal A simple PHP Toolkit to parallel generate combinations, save and use the generated terms to apply brute force attack via the http protocol. Bru

Jean Carlo de Souza 4 Jul 28, 2021
🐼 Framework agnostic package using asynchronous HTTP requests and PHP generators to load paginated items of JSON APIs into Laravel lazy collections.

Framework agnostic package using asynchronous HTTP requests and generators to load paginated items of JSON APIs into Laravel lazy collections.

Andrea Marco Sartori 61 Dec 3, 2022
Pushpin is a publish-subscribe server, supporting HTTP and WebSocket connections.

Pushpin and 1 million connections Pushpin is a publish-subscribe server, supporting HTTP and WebSocket connections. This repository contains instructi

Fanout 14 Jul 15, 2022
Composer package providing HTTP Methods, Status Codes and Reason Phrases for PHP

HTTP Enums For PHP 8.1 and above This package provides HTTP Methods, Status Codes and Reason Phrases as PHP 8.1+ enums All IANA registered HTTP Status

Alexander Pas 72 Dec 23, 2022
Event-driven, streaming HTTP client and server implementation for ReactPHP

HTTP Event-driven, streaming HTTP client and server implementation for ReactPHP. This HTTP library provides re-usable implementations for an HTTP clie

ReactPHP 640 Dec 29, 2022
A simple yet powerful HTTP metadata and assets provider for NFT collections using Symfony

Safe NFT Metadata Provider A simple yet powerful HTTP metadata and assets provider for NFT collections using Symfony.

HashLips Lab 66 Oct 7, 2022
The Library for HTTP Status Codes, Messages and Exception

This is a PHP library for HTTP status codes, messages and error exception. Within the library, HTTP status codes are available in classes based on the section they belong to. Click this link for more information.

Sabuhi Alizada 5 Sep 14, 2022
Guzzle, an extensible PHP HTTP client

Guzzle, PHP HTTP client Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services. Simple interf

Guzzle 22.3k Jan 2, 2023
A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.

Httpful Httpful is a simple Http Client library for PHP 7.2+. There is an emphasis of readability, simplicity, and flexibility – basically provide the

Nate Good 1.7k Dec 21, 2022