From cfcdb2d9aa0b7b4d206455bcbc414b6763654303 Mon Sep 17 00:00:00 2001 From: Adrian Philipp Date: Sat, 22 Feb 2014 14:17:01 +0100 Subject: [PATCH 01/24] Styling and readme update. --- README.md | 2 +- css/_phpvcr.webflow.scss | 1 - documentation/_posts/2013-10-20-configuration.md | 9 ++++----- documentation/_posts/2013-10-30-installation.md | 14 +++++++------- index.html | 16 ++++++++-------- 5 files changed, 20 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 7f61438..8dedac7 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You also need some additional tools: Then to develop the site, run: - $ grunt dev + $ grunt This will start a web server at . Grunt watches for any changes in the source files and triggers a rebuild as needed. diff --git a/css/_phpvcr.webflow.scss b/css/_phpvcr.webflow.scss index bad444d..1fb70ca 100755 --- a/css/_phpvcr.webflow.scss +++ b/css/_phpvcr.webflow.scss @@ -125,7 +125,6 @@ img { .section.grey { margin-bottom: 3px; padding-top: 78px; - padding-bottom: 8px; background-color: #ece6d8; text-align: center; } diff --git a/documentation/_posts/2013-10-20-configuration.md b/documentation/_posts/2013-10-20-configuration.md index 10c7c69..c0dca94 100644 --- a/documentation/_posts/2013-10-20-configuration.md +++ b/documentation/_posts/2013-10-20-configuration.md @@ -7,7 +7,7 @@ PHP-VCR can be configured by calling it's `configure` method which returns a `Co \VCR\VCR::configure(); -## Library hooks +### Library hooks **By default all [library hooks] are enabled**. You can specifically enable only some hooks by configuring PHP-VCR. In your bootstrap file you can do: @@ -16,12 +16,11 @@ PHP-VCR can be configured by calling it's `configure` method which returns a `Co \VCR\VCR::configure()->enableLibraryHooks(array('curl_rewrite', 'soap')); \VCR\VCR::turnOn(); - Library hooks can only intercept HTTP requests if PHP-VCR is turned on right after initializing your autoloader, before the actual class to be replaced is loaded. Once loaded php-vcr does not have any change to do its' magic and intercept any request and/or response invoked by this class. -## Request matching +### Request matching In order to replay previously recorded requests, PHP-VCR must match new HTTP requests to a recorded one. By default, it matches all aspects of a HTTP request to fully identify the resource and action. Available request matchers are: @@ -49,7 +48,7 @@ PHP-VCR allows you to define your own request matchers as callback functions and ) ->enableRequestMatchers(array('method', 'url', 'custom_matcher')); -## White- and Blacklisting paths +### White- and Blacklisting paths PHP-VCR scans and overwrites your PHP code on-the-fly in order to hook into libraries like cUrl and SOAP. By default all paths except the PHP-VCR library hooks folder are scanned. @@ -60,4 +59,4 @@ To speedup the test execution, you might want to exclude (blacklist) or specific ->setWhiteList(array('vendor/guzzle')); Paths you provide are substrings. For example if `vendor\guzzle` is on the whitelist, only files containing that path are scanned – think of `*vendor\guzzle*`. -You certainly can use white- and blacklisting in one setup, but be aware that a PHP-VCR scans and overwrites paths only if they are in a whitelist and not on a blacklist. +You certainly can use white- and blacklisting in one setup, but be aware that a PHP-VCR scans and overwrites paths only if they are in a whitelist and not on a blacklist. diff --git a/documentation/_posts/2013-10-30-installation.md b/documentation/_posts/2013-10-30-installation.md index 0083cd3..db6690b 100644 --- a/documentation/_posts/2013-10-30-installation.md +++ b/documentation/_posts/2013-10-30-installation.md @@ -9,9 +9,9 @@ PHP-VCR is available via [composer](http://getcomposer.org) which is the recomme curl -sS https://getcomposer.org/installer | php # Add PHP-VCR as a dependency - php composer.phar require php-vcr/php-vcr:~1.0 + php composer.phar require php-vcr/php-vcr -After installing you need to turn on PHP-VCR in your test bootstrap file (for example in `tests/boostrap.php`). +After installing you need to turn on PHP-VCR in your test bootstrap file (for example in `tests/boostrap.php`). **Important:** Make sure you enable PHP-VCR right after Composer's autoloader. @@ -22,7 +22,7 @@ You can find out more on how to install Composer, configure autoloading, and oth ### Requirements -For PHP-VCR to work you need a PHP version greater than PHP 5.3 and the [curl PHP extension](http://php.net/manual/en/book.curl.php). +For PHP-VCR to work you need a PHP version greater than PHP 5.3 and the [curl PHP extension](http://php.net/manual/en/book.curl.php). ### Latest version @@ -42,11 +42,11 @@ Don't forget to run `composer update` after changing your composer.json. In order to contribute, you'll need to checkout the source from GitHub and install PHP-VCR's dependencies using Composer: # Download PHP-VCR sources - git clone https://github.com/php-vcr/php-vcr.git - cd php-vcr + git clone https://github.com/php-vcr/php-vcr.git + cd php-vcr - # Install dependencies - composer install --dev + # Install dependencies + composer install # Run tests phpunit diff --git a/index.html b/index.html index 321d81d..ef6217c 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@

What?

phpvcr-overview.png
-

Fast

+

Faster tests

If you run hundreds of tests, you don't want to hit a real API all the time. This slows down your test suite quite a bit. The faster your tests are, the faster you can iterate over code changes.

Deterministic

Can you run integration tests on your notebook? Testing against live APIs require those APIs to be online all the time, and you have to be online as well. Free yourself from those dependencies.

@@ -44,25 +44,25 @@

Features

-

Simple

-

Automatically records and replays HTTP(s) interactions with minimal setup/configuration code. No modifications to your production code necessary.

+

Easy setup

+

Automatically records and replays HTTP(s) interactions with minimal setup. No modifications to your production code necessary.

-

Intercepting

+

Library support

Supports common http functions and extensions like streamWrapper (fopen(), fread(), file_get_contents()), SoapClient and cUrl.

-

Isolating

+

HTTP isolation

Disables all HTTP requests that you don't explicitly allow (except if configured).

Configurable

-

Easily configure request matching or add custom request matchers, store HTTP interactions on disk in YAML and JSON.

+

Easily configure request matching or add custom request matchers. Store HTTP interactions on disk in YAML or JSON.

-

Integrated

+

PHPUnit integration

Supports PHPUnit. Recorded requests and responses can easily be inspected and edited.

@@ -79,7 +79,7 @@

Documentation

Quick install:
-
composer require php-vcr/php-vcr +
composer require php-vcr/php-vcr
composer update
From 57b0c3fb50cbd0fd94fc7fe834fa4848c79927cb Mon Sep 17 00:00:00 2001 From: Adrian Philipp Date: Sat, 22 Feb 2014 14:19:22 +0100 Subject: [PATCH 02/24] Fixed subtitle --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index ef6217c..de0ed94 100644 --- a/index.html +++ b/index.html @@ -15,7 +15,7 @@

Record HTTP interactions in your tests