Download the PHP package zeeloengineering/zeelo-php-vcr without Composer
On this page you can find all versions of the php package zeeloengineering/zeelo-php-vcr. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zeeloengineering/zeelo-php-vcr
More information about zeeloengineering/zeelo-php-vcr
Files in zeeloengineering/zeelo-php-vcr
Package zeelo-php-vcr
Short Description Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
License MIT
Informations about the package zeelo-php-vcr
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) – this project is not yet fully tested, so please use at your own risk!
Features
- Automatically records and replays your HTTP(s) interactions with minimal setup/configuration code.
- Supports common http functions and extensions
- everyting using streamWrapper: fopen(), fread(), file_get_contents(), ... without any modification (except
$http_response_header
see #96) - SoapClient by adding
\VCR\VCR::turnOn();
in yourtests/bootstrap.php
- curl(), by adding
\VCR\VCR::turnOn();
in yourtests/bootstrap.php
- everyting using streamWrapper: fopen(), fread(), file_get_contents(), ... without any modification (except
- 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:
You can use annotations in PHPUnit by using phpunit-testlistener-vcr:
Installation
Simply run the following command:
Dependencies
PHP-VCR depends on:
- PHP 5.3+
- Curl extension
- HTTP library Guzzle
- symfony/yaml
- beberlei/assert
Composer installs all dependencies except extensions like curl.
Run tests
In order to run all tests you need to get development dependencies using composer:
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
All versions of zeelo-php-vcr with dependencies
beberlei/assert Version ^2.0
symfony/yaml Version ~2.1|^3.0|^4.0
symfony/event-dispatcher Version ^2.4|^3.0|^4.0