# php-vcr/php-vcr

Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

Repository: https://github.com/php-vcr/php-vcr
Canonical: https://ross.abutalabs.com/products/php-vcr
Homepage: http://php-vcr.github.io
Language: PHP
License: MIT
License Family: permissive
Topics: php-vcr, php, accurate-tests, replay, phpunit, api-test, api-testing, vcr, deterministic, test-automation, test-webservices, webservice, webservices, guzzle-services, guzzle-test, soap-test, soap-api, soap-api-test, rest-test, restful-test
Last push: 2026-08-16T11:52:34+00:00

## Health v2 (maintenance only)
Score: 98/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 96, longevity 100
- inputs: {"age_days": 4945, "days_push": 17, "days_rel": 28, "gap_med": 2.0, "n_releases_24m": 13}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1209, forks 215 (observed 2026-08-28T04:03:59.772477+00:00)

## What it is
PHP-VCR is a PHP port of Ruby's VCR library that records a test suite's HTTP interactions to cassette files and replays them in future test runs. It intercepts requests from common PHP HTTP clients (curl, streams, SoapClient, Guzzle) to make tests fast, deterministic, and offline-capable.

## Use cases
- record and replay http interactions in php tests
- make phpunit tests deterministic without live api calls
- mock soap api responses in tests
- test rest clients offline
- speed up test suite by avoiding real http requests
- configure request matching for recorded http responses

## When to choose
- your PHP tests hit external HTTP APIs and you want fast, repeatable runs
- you need recorded fixtures for Guzzle, curl, or SoapClient interactions
- you want configurable request matching and record modes like Ruby's VCR

## When to avoid
- you need monkey-patch-free mocking in a language other than PHP
- you only test code that never makes HTTP requests
- you prefer modern contract-testing or mock-server approaches over recorded cassettes

## Facets
- artifact type: library
- maturity: active
- function: testing, mocking, http-client
- domain: testing, developer-tools, apis
- platform: php, cli
- tags: http-mocking, vcr, cassettes, phpunit, record-and-replay, guzzle, soap, deterministic-tests

## Member repositories
- php-vcr/php-vcr (main) score 98

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:59.772477+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:18:36.385239+00:00, confidence not recorded.
  - readme: https://github.com/php-vcr/php-vcr (fetched 2026-08-28T04:03:59.772477+00:00, sha d4b436329d3f)
  - homepage: http://php-vcr.github.io (fetched 2026-08-29T12:26:21.425700+00:00, sha e9126fb6bab5)
- Data as of 2026-08-30T08:39:29.467469+00:00.
