定制 php-vcr/phpunit-testlistener-vcr 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

php-vcr/phpunit-testlistener-vcr

最新稳定版本:3.3.0

Composer 安装命令:

composer require php-vcr/phpunit-testlistener-vcr

包简介

Integrates PHPUnit with PHP-VCR.

README 文档

README

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

统计信息

  • 总下载量: 849.65k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 63
  • 点击次数: 1
  • 依赖项目数: 70
  • 推荐数: 0

GitHub 信息

  • Stars: 63
  • Watchers: 6
  • Forks: 48
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-13