11# Pest plugin for PHP-VCR
22
33![ GitHub Actions] ( https://github.com/phpjuice/pest-plugin-vcr/actions/workflows/ci.yml/badge.svg )
4- [ ![ Latest Stable Version] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/v )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
5- [ ![ Total Downloads] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/downloads )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
4+ [ ![ Latest Stable Version] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/v )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
5+ [ ![ Total Downloads] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/downloads )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
66[ ![ License] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/license )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
77
8-
9- Integrates Pest with PHP-VCR using plugins.
8+ Integrates Pest with [ PHP-VCR] ( http://php-vcr.github.io ) using plugins.
109
1110## Installation
1211
@@ -16,12 +15,24 @@ You can install the package via composer:
1615composer require phpjuice/pest-plugin-vcr --dev
1716```
1817
18+ ## Setup
19+
1920Add new folder inside tests to store cassettes:
2021
2122``` bash
2223mkdir tests/cassettes
2324```
2425
26+ Add the following line to your ` Pest.php ` file, inorder to instruct
27+ php vcr of our cassettes folder:
28+
29+ ``` php
30+ use VCR\VCR;
31+
32+
33+ VCR::configure()->setCassettePath(__DIR__.'/cassettes');
34+ ```
35+
2536## Usage
2637
2738This plugin will provide you with two handy functions ` vcrTurnOn ` & ` vcrTurnOff ` to turn on and off the http recording :
@@ -40,8 +51,8 @@ it('records requests to pestphp.com', function () {
4051});
4152```
4253
43- The previous testsuite, will first send a request to ` pestphp.com ` and
44- Record your test suite's HTTP interactions into a cassette and replay them
54+ The previous testsuite, will first send a request to ` pestphp.com ` and
55+ Record your test suite's HTTP interactions into a cassette and replay them
4556during future test runs for fast, deterministic, accurate tests.
4657
4758> ** Important** before running your tests make sure to have the following folder ` tests/cassettes `
@@ -77,6 +88,6 @@ The MIT License (MIT). Please see [License File](LICENSE.md) for more informatio
7788This package was generated using the [ PHP Package Boilerplate] ( https://laravelpackageboilerplate.com ) by [ Beyond Code] ( http://beyondco.de/ ) .
7889
7990![ GitHub Actions] ( https://github.com/phpjuice/pest-plugin-vcr/actions/workflows/ci.yml/badge.svg )
80- [ ![ Latest Stable Version] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/v )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
81- [ ![ Total Downloads] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/downloads )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
91+ [ ![ Latest Stable Version] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/v )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
92+ [ ![ Total Downloads] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/downloads )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
8293[ ![ License] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/license )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
0 commit comments