Skip to content

Commit d5548e6

Browse files
authored
update docs
1 parent bc48eb9 commit d5548e6

File tree

1 file changed

+77
-21
lines changed

1 file changed

+77
-21
lines changed

docs/index.md

Lines changed: 77 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,93 @@
1-
## Welcome to GitHub Pages
1+
# Pest plugin for PHP-VCR
22

3-
You can use the [editor on GitHub](https://github.com/phpjuice/pest-plugin-vcr/edit/main/docs/index.md) to maintain and preview the content for your website in Markdown files.
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)
6+
[![License](http://poser.pugx.org/phpjuice/pest-plugin-vcr/license)](https://packagist.org/packages/phpjuice/pest-plugin-vcr)
47

5-
Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.
8+
Integrates Pest with [PHP-VCR](http://php-vcr.github.io) using plugins.
69

7-
### Markdown
10+
## Installation
811

9-
Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for
12+
You can install the package via composer:
1013

11-
```markdown
12-
Syntax highlighted code block
14+
```bash
15+
composer require phpjuice/pest-plugin-vcr --dev
16+
```
17+
18+
## Setup
1319

14-
# Header 1
15-
## Header 2
16-
### Header 3
20+
Add new folder inside tests to store cassettes:
21+
22+
```bash
23+
mkdir tests/cassettes
24+
```
1725

18-
- Bulleted
19-
- List
26+
Add the following line to your `Pest.php` file, inorder to instruct
27+
php vcr of our cassettes folder:
2028

21-
1. Numbered
22-
2. List
29+
```php
30+
use VCR\VCR;
2331

24-
**Bold** and _Italic_ and `Code` text
2532

26-
[Link](url) and ![Image](src)
33+
VCR::configure()->setCassettePath(__DIR__.'/cassettes');
2734
```
2835

29-
For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).
36+
## Usage
37+
38+
This plugin will provide you with two handy functions `vcrTurnOn` & `vcrTurnOff` to turn on and off the http recording :
39+
40+
```php
41+
it('records requests to pestphp.com', function () {
42+
43+
vcrTurnOn('pestphp.com');
44+
45+
$result = file_get_contents('https://pestphp.com/');
46+
47+
expect($result)
48+
->toBe('Hello from pestphp.');
49+
50+
vcrTurnOff();
51+
});
52+
```
53+
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
56+
during future test runs for fast, deterministic, accurate tests.
57+
58+
> **Important** before running your tests make sure to have the following folder `tests/cassettes`
59+
60+
### Testing
61+
62+
```bash
63+
composer test
64+
```
65+
66+
### Changelog
67+
68+
Please see [CHANGELOG](../CHANGELOG.md) for more information what has changed recently.
69+
70+
## Contributing
71+
72+
Please see [CONTRIBUTING](../CONTRIBUTING.md) for details.
73+
74+
### Security
75+
76+
If you discover any security related issues, reach out to me @tsd_mohammed instead of using the issue tracker.
77+
78+
## Credits
79+
80+
- [All Contributors](../../../contributors)
81+
82+
## License
3083

31-
### Jekyll Themes
84+
The MIT License (MIT). Please see [License File](../LICENSE.md) for more information.
3285

33-
Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/phpjuice/pest-plugin-vcr/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file.
86+
## PHP Package Boilerplate
3487

35-
### Support or Contact
88+
This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com) by [Beyond Code](http://beyondco.de/).
3689

37-
Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out.
90+
![GitHub Actions](https://github.com/phpjuice/pest-plugin-vcr/actions/workflows/ci.yml/badge.svg)
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)
93+
[![License](http://poser.pugx.org/phpjuice/pest-plugin-vcr/license)](https://packagist.org/packages/phpjuice/pest-plugin-vcr)

0 commit comments

Comments
 (0)