php-http / vcr-plugin
Record your test suite's HTTP interactions and replay them during future test runs.
Installs: 182 717
Dependents: 12
Suggesters: 1
Security: 0
Stars: 20
Watchers: 8
Forks: 4
Open Issues: 0
Requires
- php: ^7.2 || ^8.0
- guzzlehttp/psr7: ^1.7 || ^2.0
- php-http/client-common: ^2.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- symfony/filesystem: ^4.0|^5.0|^6.0|^7.0
- symfony/options-resolver: ^4.0|^5.0|^6.0|^7.0
Requires (Dev)
- phpstan/phpstan: ^1.0
- symfony/phpunit-bridge: ^4.2|^5.0|^6.0|^7.0
README
Record your test suite's HTTP interactions and replay them during future test runs.
Install
Via Composer
$ composer require --dev php-http/vcr-plugin
Usage
<?php use Http\Client\Plugin\Vcr\NamingStrategy\PathNamingStrategy; use Http\Client\Plugin\Vcr\Recorder\FilesystemRecorder; use Http\Client\Plugin\Vcr\RecordPlugin; use Http\Client\Plugin\Vcr\ReplayPlugin; $namingStrategy = new PathNamingStrategy(); $recorder = new FilesystemRecorder('some/dir/in/vcs'); // You can use InMemoryRecorder as well // To record responses: $record = new RecordPlugin($namingStrategy, $recorder); // To replay responses: $replay = new ReplayPlugin($namingStrategy, $recorder);
Testing
$ composer test
$ composer test-static
Contributing
Please see our contributing guide.
Security
If you discover any security related issues, please contact us at security@php-http.org.
License
The MIT License (MIT). Please see License File for more information.