File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -16,23 +16,15 @@ You can install the package via composer:
16
16
composer require phpjuice/pest-plugin-vcr --dev
17
17
```
18
18
19
- ## Usage
20
-
21
- To make this plugin functionality available, we need to let Pest know that it should use it.
22
-
23
- We will do this by adding the following to your ` Pest.php ` :
19
+ Add new folder inside tests to store cassettes:
24
20
25
- ``` php
26
- use PHPJuice\PestPluginVcr\PestPluginVcr;
27
-
28
- Pest\Plugin::uses(PestPluginVcr::class);
21
+ ``` bash
22
+ mkdir tests/cassettes
29
23
```
30
24
31
- ## Example
25
+ ## Usage
32
26
33
- The following testsuite, will first send a request to ` pestphp.com ` and
34
- Record your test suite's HTTP interactions into a cassette and replay them
35
- during future test runs for fast, deterministic, accurate tests...
27
+ This plugin will provide you with two handy functions ` vcrTurnOn ` & ` vcrTurnOff ` to turn on and off the http recording :
36
28
37
29
``` php
38
30
it('records requests to pestphp.com', function () {
@@ -47,6 +39,13 @@ it('records requests to pestphp.com', function () {
47
39
vcrTurnOff();
48
40
});
49
41
```
42
+
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
45
+ during future test runs for fast, deterministic, accurate tests.
46
+
47
+ > ** Important** before running your tests make sure to have the following folder ` tests/cassettes `
48
+
50
49
### Testing
51
50
52
51
``` bash
You can’t perform that action at this time.
0 commit comments