testo / bridge-vcr
PHP-VCR bridge for the Testo testing framework.
Fund package maintenance!
0.1.0
2026-08-10 12:40 UTC
Requires
- php: >=8.2
- php-vcr/php-vcr: ^1.6
- testo/testo: 0.10.40 - 1
Requires (Dev)
- testo/assert: ^0.1.12
- testo/codecov: ^0.1.12
- testo/test: ^0.1.6
README
PHP-VCR bridge
Important
🪞 This is a read-only mirror.
Active development of the Testo project lives in php-testo/testo under bridge/vcr/. This repository is automatically synchronized from there on every release.
File issues and pull requests in the main monorepo, not here.
About
PHP-VCR integration for Testo. Mark any test with #[VCR('cassette')]: its HTTP interactions are recorded to a cassette on the first run and replayed from it afterwards, so the test stays fast, deterministic, and offline. The attribute is self-wiring — no plugin registration required.
use Testo\Attribute\Test; use Testo\Bridge\VCR; use Testo\Bridge\VCR\RecordMode; #[Test] #[VCR('github-user', mode: RecordMode::None)] public function fetches_a_user(): void { $json = \file_get_contents('https://api.github.com/users/roxblnfk'); // asserts... }
Register VcrPlugin only to point php-vcr at a non-default cassette directory:
// testo.php use Testo\Application\Config\ApplicationConfig; use Testo\Application\Config\SuiteConfig; use Testo\Bridge\VCR\VcrPlugin; return new ApplicationConfig( plugins: [new VcrPlugin(cassettePath: __DIR__ . '/tests/fixtures')], suites: [new SuiteConfig(name: 'Feature', location: ['tests/Feature'])], );
Install
composer require --dev testo/bridge-vcr