Registry / testing / php-vcr-phpunit-testlistener-vcr

php-vcr-phpunit-testlistener-vcr

JSON →
library3.3.0phppackagistunverified

Integrates PHPUnit with PHP-VCR for recording and replaying HTTP interactions.

composer require php-vcr/phpunit-testlistener-vcr
INSTALL
IMPORT
SIG · PHP-VCR-PHPUNIT-TE
P
php-vcr-phpunit-testlistener-vcr
testingphpv3.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VCRTestListener
use VCR\PHPUnit\TestListener\VCRTestListener;

Automatically record and replay HTTP requests in PHPUnit tests.

<?php require 'vendor/autoload.php'; use VCR\PHPUnit\TestListener\VCRTestListener; class MyTest extends \PHPUnit\Framework\TestCase { public static function setUpBeforeClass(): void { \VCR\VCR::turnOn(); } public function testHttpRequest() { \VCR\VCR::insertCassette('example'); $response = file_get_contents('http://example.com'); $this->assertStringContainsString('Example Domain', $response); } }
Debug
Known issues
gotchaRequires PHP-VCR library and may conflict with other HTTP mocking tools.
fix
Ensure PHP-VCR is installed and configured correctly.
affects: >=3.0.0
Upgrade
Version history
3.3.0latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
9 hits · last 30 days
node
8
Resources
php-vcr-phpunit-testlistener-vcr — pip install php-vcr-phpunit-testlistener-vcr · libregistry