testo/bridge-vcr

PHP-VCR bridge for the Testo testing framework.

Maintainers

Package info

github.com/php-testo/bridge-vcr

pkg:composer/testo/bridge-vcr

Transparency log

Fund package maintenance!

Boosty

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

0.1.0 2026-08-10 12:40 UTC

This package is auto-updated.

Last update: 2026-08-10 12:46:25 UTC


README

TESTO

PHP-VCR bridge

Documentation Support on Boosty


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

PHP Latest Version on Packagist License Total Downloads