PHPackages                             datingvip/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. datingvip/phpunit-testlistener-vcr

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

datingvip/phpunit-testlistener-vcr
==================================

Integrates PHPUnit with PHP-VCR.

3.3.0(5y ago)0167MITPHPPHP ^7.1|^8.0

Since May 15Pushed 5y agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (21)Used By (0)

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

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

Integrates PHPUnit with [PHP-VCR](http://github.com/php-vcr/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.

[![Build Status](https://camo.githubusercontent.com/2fc8baa26b4d147db5aa58be96ee3c745665fb54f9337c9ee675f911267aa574/68747470733a2f2f7472617669732d63692e6f72672f7068702d7663722f706870756e69742d746573746c697374656e65722d7663722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-vcr/phpunit-testlistener-vcr)

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 php-vcr/phpunit-testlistener-vcr
```

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

```

```

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

[](#dependencies)

PHPUnit-Testlistener-VCR depends on:

- PHP 7.1+
- PHP 7.0+ (use &lt;3.0)
- [php-vcr/php-vcr](https://github.com/php-vcr/php-vcr)

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/php-vcr/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/php-vcr/phpunit-testlistener-vcr/graphs/contributors)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity77

Established project with proven stability

 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 ~167 days

Recently: every ~243 days

Total

18

Last Release

1906d ago

Major Versions

1.1.7 → 2.0.02016-12-19

2.0.0 → 3.0.02017-08-08

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

3.2.0PHP ^7.1

3.3.0PHP ^7.1|^8.0

### Community

Maintainers

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

---

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)")[![kornrunner](https://avatars.githubusercontent.com/u/725986?v=4)](https://github.com/kornrunner "kornrunner (3 commits)")[![alnorth](https://avatars.githubusercontent.com/u/672745?v=4)](https://github.com/alnorth "alnorth (2 commits)")[![chrisguitarguy](https://avatars.githubusercontent.com/u/1010392?v=4)](https://github.com/chrisguitarguy "chrisguitarguy (2 commits)")[![dborsatto](https://avatars.githubusercontent.com/u/94651?v=4)](https://github.com/dborsatto "dborsatto (2 commits)")[![MrRio](https://avatars.githubusercontent.com/u/47539?v=4)](https://github.com/MrRio "MrRio (2 commits)")[![GaryJones](https://avatars.githubusercontent.com/u/88371?v=4)](https://github.com/GaryJones "GaryJones (2 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)")[![justincy](https://avatars.githubusercontent.com/u/1037458?v=4)](https://github.com/justincy "justincy (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M677](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M753](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.0k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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