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: Readme.md
+10-14Lines changed: 10 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,28 +7,24 @@
7
7
8
8
This is a port of [VCR](http://github.com/vcr/vcr) for ruby.
9
9
10
-
Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
10
+
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](http://php-vcr.github.io).
11
11
12
12
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!
13
13
14
14
## Features
15
15
16
16
* Automatically records and replays your HTTP(s) interactions with minimal setup/configuration code.
17
17
* Supports common http functions and extensions
18
-
* everyting using [streamWrapper](http://php.net/manual/en/class.streamwrapper.php): fopen(), fread(), file_get_contents(), ... without any modification
18
+
* everyting using [streamWrapper](http://php.net/manual/en/class.streamwrapper.php): fopen(), fread(), file_get_contents(), ... without any modification (except `$http_response_header` see #96)
19
19
*[SoapClient](http://www.php.net/manual/en/soapclient.soapclient.php) by adding `\VCR\VCR\turnOn();` in your `tests/boostrap.php`
20
20
* curl(), by adding `\VCR\VCR::turnOn();` in your `tests/boostrap.php`
21
-
* The same request can receive different responses in different tests--just use different cassettes.
22
-
* Disables all HTTP requests that you don't explicitly allow (except SoapClient if not configured).
23
-
* Request matching is configurable based on HTTP method, URI, host, path, body and headers, or you can easily
21
+
* The same request can receive different responses in different tests -- just use different cassettes.
22
+
* Disables all HTTP requests that you don't explicitly allow by [setting the record mode](http://php-vcr.github.io/documentation/configuration/)
23
+
*[Request matching](http://php-vcr.github.io/documentation/configuration/) is configurable based on HTTP method, URI, host, path, body and headers, or you can easily
24
24
implement a custom request matcher to handle any need.
25
25
* The recorded requests and responses are stored on disk in a serialization format of your choice
26
26
(currently YAML and JSON are built in, and you can easily implement your own custom serializer)
27
27
* Supports PHPUnit annotations.
28
-
* Todo: Recorded requests and responses can easily be inspected and edited.
29
-
* Todo: Automatically filters confidential or private information like passwords, auth tokens and emails.
30
-
* Todo: Automatically re-records cassettes on a configurable regular interval to keep them fresh and current.
31
-
* Todo: Has a good documentation ;-)
32
28
33
29
## Usage example
34
30
@@ -40,20 +36,20 @@ class VCRTest extends \PHPUnit_Framework_TestCase
40
36
public function testShouldInterceptStreamWrapper()
41
37
{
42
38
// After turning on the VCR will intercept all requests
43
-
VCR::turnOn();
39
+
\VCR\VCR::turnOn();
44
40
45
41
// Record requests and responses in cassette file 'example'
46
-
VCR::insertCassette('example');
42
+
\VCR\VCR::insertCassette('example');
47
43
48
44
// Following request will be recorded once and replayed in future test runs
0 commit comments