1
1
# Pest plugin for PHP-VCR
2
2
3
3
![ 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 )
6
6
[ ![ License] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/license )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
7
7
8
-
9
- Integrates Pest with PHP-VCR using plugins.
8
+ Integrates Pest with [ PHP-VCR] ( http://php-vcr.github.io ) using plugins.
10
9
11
10
## Installation
12
11
@@ -16,12 +15,24 @@ You can install the package via composer:
16
15
composer require phpjuice/pest-plugin-vcr --dev
17
16
```
18
17
18
+ ## Setup
19
+
19
20
Add new folder inside tests to store cassettes:
20
21
21
22
``` bash
22
23
mkdir tests/cassettes
23
24
```
24
25
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
+
25
36
## Usage
26
37
27
38
This 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 () {
40
51
});
41
52
```
42
53
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
45
56
during future test runs for fast, deterministic, accurate tests.
46
57
47
58
> ** 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
77
88
This package was generated using the [ PHP Package Boilerplate] ( https://laravelpackageboilerplate.com ) by [ Beyond Code] ( http://beyondco.de/ ) .
78
89
79
90
![ 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 )
82
93
[ ![ License] ( http://poser.pugx.org/phpjuice/pest-plugin-vcr/license )] ( https://packagist.org/packages/phpjuice/pest-plugin-vcr )
0 commit comments