diff --git a/docs/_config.yml b/_config.yml similarity index 100% rename from docs/_config.yml rename to _config.yml diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php deleted file mode 100644 index b53e7a8..0000000 --- a/bootstrap/autoload.php +++ /dev/null @@ -1,15 +0,0 @@ -setCassettePath(__DIR__."/../tests/cassettes"); -VCR::turnOn(); \ No newline at end of file diff --git a/composer.json b/composer.json index e19afc9..87c7dd6 100644 --- a/composer.json +++ b/composer.json @@ -15,9 +15,15 @@ "role": "Developer" } ], + "repositories": [ + { + "type": "git", + "url": "https://github.com/phpjuice/php-vcr" + } + ], "require": { "php": "^7.4|^8.0", - "php-vcr/php-vcr": "^1.5" + "php-vcr/php-vcr": "dev-master as 1.5" }, "require-dev": { "ext-curl": "*", diff --git a/composer.lock b/composer.lock index 45d7610..5acdc39 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6ebd33ed3f3e33f55b585747e7445b1c", + "content-hash": "48d2d156d88b873e96a0dc497c7e73a6", "packages": [ { "name": "beberlei/assert", @@ -75,22 +75,16 @@ }, { "name": "php-vcr/php-vcr", - "version": "1.5.2", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/php-vcr/php-vcr.git", - "reference": "989fdcad482d830890757b8165127ed0183de41b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-vcr/php-vcr/zipball/989fdcad482d830890757b8165127ed0183de41b", - "reference": "989fdcad482d830890757b8165127ed0183de41b", - "shasum": "" + "url": "https://github.com/phpjuice/php-vcr", + "reference": "e8154b5b5152087e725f6319dc7e39d85aaa3540" }, "require": { "beberlei/assert": "^3.2.5", "ext-curl": "*", - "php": ">=7.2", + "php": ">=7.3", "symfony/event-dispatcher": "^2.4|^3.0|^4.0|^5.0", "symfony/yaml": "~2.1|^3.0|^4.0|^5.0" }, @@ -103,13 +97,32 @@ "sebastian/version": "^1.0.3|^2.0", "thecodingmachine/phpstan-strict-rules": "^0.12" }, + "default-branch": true, "type": "library", "autoload": { "psr-4": { "VCR\\": "src/VCR/" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "classmap": [ + "tests/" + ] + }, + "scripts": { + "test": [ + "./vendor/bin/phpunit" + ], + "lint": [ + "./vendor/bin/php-cs-fixer fix --verbose --diff --dry-run" + ], + "fix": [ + "./vendor/bin/php-cs-fixer fix --verbose --diff" + ], + "phpstan": [ + "phpstan analyse -c phpstan.neon --no-progress -vvv" + ] + }, "license": [ "MIT" ], @@ -120,11 +133,7 @@ } ], "description": "Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.", - "support": { - "issues": "https://github.com/php-vcr/php-vcr/issues", - "source": "https://github.com/php-vcr/php-vcr/tree/1.5.2" - }, - "time": "2021-03-20T10:01:20+00:00" + "time": "2021-08-22T09:39:22+00:00" }, { "name": "psr/event-dispatcher", @@ -245,16 +254,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v5.3.4", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "f2fd2208157553874560f3645d4594303058c4bd" + "reference": "ce7b20d69c66a20939d8952b617506a44d102130" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f2fd2208157553874560f3645d4594303058c4bd", - "reference": "f2fd2208157553874560f3645d4594303058c4bd", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ce7b20d69c66a20939d8952b617506a44d102130", + "reference": "ce7b20d69c66a20939d8952b617506a44d102130", "shasum": "" }, "require": { @@ -310,7 +319,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.4" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.3.7" }, "funding": [ { @@ -326,7 +335,7 @@ "type": "tidelift" } ], - "time": "2021-07-23T15:55:36+00:00" + "time": "2021-08-04T21:20:46+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -770,16 +779,16 @@ }, { "name": "filp/whoops", - "version": "2.14.0", + "version": "2.14.1", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "fdf92f03e150ed84d5967a833ae93abffac0315b" + "reference": "15ead64e9828f0fc90932114429c4f7923570cb1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/fdf92f03e150ed84d5967a833ae93abffac0315b", - "reference": "fdf92f03e150ed84d5967a833ae93abffac0315b", + "url": "https://api.github.com/repos/filp/whoops/zipball/15ead64e9828f0fc90932114429c4f7923570cb1", + "reference": "15ead64e9828f0fc90932114429c4f7923570cb1", "shasum": "" }, "require": { @@ -829,7 +838,7 @@ ], "support": { "issues": "https://github.com/filp/whoops/issues", - "source": "https://github.com/filp/whoops/tree/2.14.0" + "source": "https://github.com/filp/whoops/tree/2.14.1" }, "funding": [ { @@ -837,7 +846,7 @@ "type": "github" } ], - "time": "2021-07-13T12:00:00+00:00" + "time": "2021-08-29T12:00:00+00:00" }, { "name": "myclabs/deep-copy", @@ -1043,20 +1052,20 @@ }, { "name": "pestphp/pest", - "version": "v1.17.0", + "version": "v1.18.0", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "075c31bc78a6ae864de0291c07692b628fbcda56" + "reference": "60c06365233f8b7f6958799529f42cea7f9fbaf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/075c31bc78a6ae864de0291c07692b628fbcda56", - "reference": "075c31bc78a6ae864de0291c07692b628fbcda56", + "url": "https://api.github.com/repos/pestphp/pest/zipball/60c06365233f8b7f6958799529f42cea7f9fbaf8", + "reference": "60c06365233f8b7f6958799529f42cea7f9fbaf8", "shasum": "" }, "require": { - "nunomaduro/collision": "^5.4.0", + "nunomaduro/collision": "^5.4.0|^6.0", "pestphp/pest-plugin": "^1.0.0", "php": "^7.3 || ^8.0", "phpunit/phpunit": "^9.5.5" @@ -1119,7 +1128,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v1.17.0" + "source": "https://github.com/pestphp/pest/tree/v1.18.0" }, "funding": [ { @@ -1147,7 +1156,7 @@ "type": "patreon" } ], - "time": "2021-08-26T20:17:03+00:00" + "time": "2021-08-29T23:05:26+00:00" }, { "name": "pestphp/pest-plugin", @@ -3042,16 +3051,16 @@ }, { "name": "symfony/console", - "version": "v5.3.6", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2" + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/51b71afd6d2dc8f5063199357b9880cea8d8bfe2", - "reference": "51b71afd6d2dc8f5063199357b9880cea8d8bfe2", + "url": "https://api.github.com/repos/symfony/console/zipball/8b1008344647462ae6ec57559da166c2bfa5e16a", + "reference": "8b1008344647462ae6ec57559da166c2bfa5e16a", "shasum": "" }, "require": { @@ -3121,7 +3130,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.3.6" + "source": "https://github.com/symfony/console/tree/v5.3.7" }, "funding": [ { @@ -3137,7 +3146,7 @@ "type": "tidelift" } ], - "time": "2021-07-27T19:10:22+00:00" + "time": "2021-08-25T20:02:16+00:00" }, { "name": "symfony/polyfill-intl-grapheme", @@ -3544,16 +3553,16 @@ }, { "name": "symfony/string", - "version": "v5.3.3", + "version": "v5.3.7", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1" + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", - "reference": "bd53358e3eccec6a670b5f33ab680d8dbe1d4ae1", + "url": "https://api.github.com/repos/symfony/string/zipball/8d224396e28d30f81969f083a58763b8b9ceb0a5", + "reference": "8d224396e28d30f81969f083a58763b8b9ceb0a5", "shasum": "" }, "require": { @@ -3607,7 +3616,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.3.3" + "source": "https://github.com/symfony/string/tree/v5.3.7" }, "funding": [ { @@ -3623,7 +3632,7 @@ "type": "tidelift" } ], - "time": "2021-06-27T11:44:38+00:00" + "time": "2021-08-26T08:00:08+00:00" }, { "name": "theseer/tokenizer", @@ -3734,9 +3743,18 @@ "time": "2021-03-09T10:59:23+00:00" } ], - "aliases": [], + "aliases": [ + { + "package": "php-vcr/php-vcr", + "version": "9999999-dev", + "alias": "1.5", + "alias_normalized": "1.5.0.0" + } + ], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "php-vcr/php-vcr": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index cf829a0..0000000 --- a/docs/index.md +++ /dev/null @@ -1,93 +0,0 @@ -# Pest plugin for PHP-VCR - -![Tests](https://github.com/phpjuice/pest-plugin-vcr/actions/workflows/ci.yml/badge.svg) -[![Latest Stable Version](http://poser.pugx.org/phpjuice/pest-plugin-vcr/v)](https://packagist.org/packages/phpjuice/pest-plugin-vcr) -[![Total Downloads](http://poser.pugx.org/phpjuice/pest-plugin-vcr/downloads)](https://packagist.org/packages/phpjuice/pest-plugin-vcr) -[![License](http://poser.pugx.org/phpjuice/pest-plugin-vcr/license)](https://packagist.org/packages/phpjuice/pest-plugin-vcr) - -Integrates Pest with [PHP-VCR](http://php-vcr.github.io) using plugins. - -## Installation - -You can install the package via composer: - -```bash -composer require phpjuice/pest-plugin-vcr --dev -``` - -## Setup - -Add new folder inside tests to store cassettes: - -```bash -mkdir tests/cassettes -``` - -Add the following line to your `Pest.php` file, this will tell -VCR where to look for `cassettes`: - -```php -use VCR\VCR; - - -VCR::configure()->setCassettePath(__DIR__.'/cassettes'); -``` - -## Usage - -This plugin will provide you with two handy functions `vcrTurnOn` & `vcrTurnOff` to turn on and off the http recording : - -```php -it('records requests to pestphp.com', function () { - - vcrTurnOn('pestphp.com'); - - $result = file_get_contents('https://pestphp.com/'); - - expect($result) - ->toBe('Hello from pestphp.'); - - vcrTurnOff(); -}); -``` - -The previous testsuite, will first send a request to `pestphp.com` and -Record your test suite's HTTP interactions into a cassette and replay them -during future test runs for fast, deterministic, accurate tests. - -> **Important** before running your tests make sure to have the following folder `tests/cassettes` - -### Testing - -```bash -composer test -``` - -### Changelog - -Please see [CHANGELOG](../CHANGELOG.md) for more information what has changed recently. - -## Contributing - -Please see [CONTRIBUTING](../CONTRIBUTING.md) for details. - -### Security - -If you discover any security related issues, send us an email to phpjuice@gmail.com instead of using the issue tracker. - -## Credits - -- [All Contributors](../../../contributors) - -## License - -The MIT License (MIT). Please see [License File](../LICENSE.md) for more information. - -## PHP Package Boilerplate - -This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com) by [Beyond Code](http://beyondco.de/). - -![Tests](https://github.com/phpjuice/pest-plugin-vcr/actions/workflows/ci.yml/badge.svg) -[![Latest Stable Version](http://poser.pugx.org/phpjuice/pest-plugin-vcr/v)](https://packagist.org/packages/phpjuice/pest-plugin-vcr) -[![Total Downloads](http://poser.pugx.org/phpjuice/pest-plugin-vcr/downloads)](https://packagist.org/packages/phpjuice/pest-plugin-vcr) -[![License](http://poser.pugx.org/phpjuice/pest-plugin-vcr/license)](https://packagist.org/packages/phpjuice/pest-plugin-vcr) diff --git a/phpunit.xml b/phpunit.xml index 32ebc5d..081a6ad 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@