PHPackages                             ivancli/phpunit-testlistener-vcr - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. ivancli/phpunit-testlistener-vcr

ActiveLibrary[Testing &amp; Quality](/categories/testing)

ivancli/phpunit-testlistener-vcr
================================

Integrates PHPUnit with PHP-VCR.

v4.0.1(1y ago)012MITPHP ^8.1

Since May 15Pushed 1y agoCompare

[ Source](https://github.com/ivancli/phpunit-testlistener-vcr)[ Packagist](https://packagist.org/packages/ivancli/phpunit-testlistener-vcr)[ RSS](/packages/ivancli-phpunit-testlistener-vcr/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (26)Used By (0)

PHPUnit TestListener for PHP-VCR
================================

[](#phpunit-testlistener-for-php-vcr)

[![CI Tests](https://github.com/covergenius/phpunit-testlistener-vcr/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/covergenius/phpunit-testlistener-vcr/actions)[![License](https://camo.githubusercontent.com/a06a83bf30d4282ebb89bc3674dc39b6c5e986783d370017deef46194dbfa6b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f76657267656e6975732f706870756e69742d746573746c697374656e65722d7663722e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Development Version](https://camo.githubusercontent.com/ed16c5301e640a7c963209761dac91b81ba4c1dd71df99251a3a0e6e22dba8da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f767072652f636f76657267656e6975732f706870756e69742d746573746c697374656e65722d7663722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/covergenius/phpunit-testlistener-vcr)[![Monthly Installs](https://camo.githubusercontent.com/b02ad3a6e9b6974ceef77a6ffa0a5c8e45b6b37f8a629f9d80d0bde9384fa734/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f636f76657267656e6975732f706870756e69742d746573746c697374656e65722d7663722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/covergenius/phpunit-testlistener-vcr)

Integrates PHPUnit with [PHP-VCR](http://github.com/covergenius/php-vcr) using annotations.

[![PHP-VCR](https://user-images.githubusercontent.com/133832/27151811-0d95c6c4-514c-11e7-834e-eff1eec2ea16.png)](https://user-images.githubusercontent.com/133832/27151811-0d95c6c4-514c-11e7-834e-eff1eec2ea16.png)

Use `@vcr cassette_name` on your tests to turn VCR automatically on and off.

Usage example
-------------

[](#usage-example)

```
use PHPUnit\Framework\TestCase;

class VCRTest extends TestCase
{
    /**
     * @vcr unittest_annotation_test
     */
    public function testInterceptsWithAnnotations()
    {
        // Content of tests/fixtures/unittest_annotation_test: "This is a annotation test dummy".
        $result = file_get_contents('http://google.com');
        $this->assertEquals('This is a annotation test dummy.', $result, 'Call was not intercepted (using annotations).');
    }
}
```

Installation
------------

[](#installation)

1. Install using composer:

```
composer require --dev covergenius/phpunit-testlistener-vcr
```

### For phpunit version 10+

[](#for-phpunit-version-10)

2. Add listener to your `phpunit.xml`:

```

```

### For phpunit version 9 and below

[](#for-phpunit-version-9-and-below)

```

```

Dependencies
------------

[](#dependencies)

PHPUnit-Testlistener-VCR depends on the following;

- [php-vcr/php-vcr](https://github.com/covergenius/php-vcr)

### Version 4

[](#version-4)

- PHP 8.1+
- PHPUnit &gt;=10

### Version 3

[](#version-3)

- PHP 7.1+
- PHPUnit &lt;10

Run tests
---------

[](#run-tests)

In order to run all tests you need to get development dependencies using composer:

```
composer install
./vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

**The changelog is manage at [PHPUnit testlistener for PHP-VCR releases page](https://github.com/covergenius/phpunit-testlistener-vcr/releases).**

Copyright
---------

[](#copyright)

Copyright (c) 2013-2018 Adrian Philipp. Released under the terms of the MIT license. See LICENSE for details. [Contributors](https://github.com/covergenius/phpunit-testlistener-vcr/graphs/contributors)

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~215 days

Recently: every ~178 days

Total

20

Last Release

701d ago

Major Versions

1.1.7 → 2.0.02016-12-19

2.0.0 → 3.0.02017-08-08

v3.x-dev → v4.0.02023-07-14

PHP version history (4 changes)1.0.0PHP &gt;=5.3.15

3.2.0PHP ^7.1

v3.3.0PHP ^7.4||^8.0

v4.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/eda4747112afef8cecf0a6961b74aa211e020e1e9d1885e8cc7f99a6ae314ea4?d=identicon)[ketchol](/maintainers/ketchol)

---

Top Contributors

[![adri](https://avatars.githubusercontent.com/u/133832?v=4)](https://github.com/adri "adri (29 commits)")[![renatomefi](https://avatars.githubusercontent.com/u/823634?v=4)](https://github.com/renatomefi "renatomefi (16 commits)")[![specialtactics](https://avatars.githubusercontent.com/u/2955754?v=4)](https://github.com/specialtactics "specialtactics (4 commits)")[![sf-cg](https://avatars.githubusercontent.com/u/99694531?v=4)](https://github.com/sf-cg "sf-cg (3 commits)")[![dborsatto](https://avatars.githubusercontent.com/u/94651?v=4)](https://github.com/dborsatto "dborsatto (2 commits)")[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (2 commits)")[![chrisguitarguy](https://avatars.githubusercontent.com/u/1010392?v=4)](https://github.com/chrisguitarguy "chrisguitarguy (2 commits)")[![MrRio](https://avatars.githubusercontent.com/u/47539?v=4)](https://github.com/MrRio "MrRio (2 commits)")[![alnorth](https://avatars.githubusercontent.com/u/672745?v=4)](https://github.com/alnorth "alnorth (2 commits)")[![justincy](https://avatars.githubusercontent.com/u/1037458?v=4)](https://github.com/justincy "justincy (1 commits)")[![ivancli](https://avatars.githubusercontent.com/u/14046763?v=4)](https://github.com/ivancli "ivancli (1 commits)")[![cg-x](https://avatars.githubusercontent.com/u/53591541?v=4)](https://github.com/cg-x "cg-x (1 commits)")[![Sevavietl](https://avatars.githubusercontent.com/u/1844827?v=4)](https://github.com/Sevavietl "Sevavietl (1 commits)")[![janhartigan](https://avatars.githubusercontent.com/u/580052?v=4)](https://github.com/janhartigan "janhartigan (1 commits)")[![jorgemudry](https://avatars.githubusercontent.com/u/1508989?v=4)](https://github.com/jorgemudry "jorgemudry (1 commits)")

### Embed Badge

![Health badge](/badges/ivancli-phpunit-testlistener-vcr/health.svg)

```
[![Health](https://phpackages.com/badges/ivancli-phpunit-testlistener-vcr/health.svg)](https://phpackages.com/packages/ivancli-phpunit-testlistener-vcr)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k136.1M985](/packages/brianium-paratest)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[webmozarts/strict-phpunit

Enables type-safe comparisons of objects in PHPUnit

30314.4k7](/packages/webmozarts-strict-phpunit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
