Skip to content

Commit bf6f195

Browse files
committed
Links website (documentation) and clarifies some features.
1 parent 394737a commit bf6f195

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

Readme.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,24 @@
77

88
This is a port of [VCR](http://github.com/vcr/vcr) for ruby.
99

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).
1111

1212
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!
1313

1414
## Features
1515

1616
* Automatically records and replays your HTTP(s) interactions with minimal setup/configuration code.
1717
* 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)
1919
* [SoapClient](http://www.php.net/manual/en/soapclient.soapclient.php) by adding `\VCR\VCR\turnOn();` in your `tests/boostrap.php`
2020
* 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
2424
implement a custom request matcher to handle any need.
2525
* The recorded requests and responses are stored on disk in a serialization format of your choice
2626
(currently YAML and JSON are built in, and you can easily implement your own custom serializer)
2727
* 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 ;-)
3228

3329
## Usage example
3430

@@ -40,20 +36,20 @@ class VCRTest extends \PHPUnit_Framework_TestCase
4036
public function testShouldInterceptStreamWrapper()
4137
{
4238
// After turning on the VCR will intercept all requests
43-
VCR::turnOn();
39+
\VCR\VCR::turnOn();
4440

4541
// Record requests and responses in cassette file 'example'
46-
VCR::insertCassette('example');
42+
\VCR\VCR::insertCassette('example');
4743

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

5248
// To stop recording requests, eject the cassette
53-
VCR::eject();
49+
\VCR\VCR::eject();
5450

5551
// Turn off VCR to stop intercepting requests
56-
VCR::turnOff();
52+
\VCR\VCR::turnOff();
5753
}
5854

5955
public function testShouldThrowExceptionIfNoCasettePresent()
@@ -63,7 +59,7 @@ class VCRTest extends \PHPUnit_Framework_TestCase
6359
"Invalid http request. No cassette inserted. Please make sure to insert "
6460
. "a cassette in your unit test using VCR::insertCassette('name');"
6561
);
66-
VCR::turnOn();
62+
\VCR\VCR::turnOn();
6763
// If there is no cassette inserted, a request throws an exception
6864
file_get_contents('http://example.com');
6965
}

0 commit comments

Comments
 (0)