Registry /
testing / php-vcr-phpunit-testlistener-vcr
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);
}
}
Audit
Dependencies
No dependency data recorded yet.