Code Monkey home page Code Monkey logo

phpunit-testlistener-vcr's Introduction

PHPUnit TestListener for PHP-VCR

Integrates PHPUnit with PHP-VCR using annotations.

PHP-VCR

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

Build Status

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

  1. Install using composer:
composer require --dev php-vcr/phpunit-testlistener-vcr
  1. Add listener to your phpunit.xml:
<listeners>
    <listener class="VCR\PHPUnit\TestListener\VCRTestListener" file="vendor/php-vcr/phpunit-testlistener-vcr/src/VCRTestListener.php" />
</listeners>

Dependencies

PHPUnit-Testlistener-VCR depends on:

Run tests

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

composer install
./vendor/bin/phpunit

Changelog

The changelog is manage at PHPUnit testlistener for PHP-VCR releases page.

Copyright

Copyright (c) 2013-2018 Adrian Philipp. Released under the terms of the MIT license. See LICENSE for details. Contributors

phpunit-testlistener-vcr's People

Contributors

adri avatar alnorth avatar chrisguitarguy avatar dborsatto avatar garyjones avatar janhartigan avatar jorgemudry avatar justincy avatar kornrunner avatar mrrio avatar renatomefi avatar sevavietl avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.