定制 lstrojny/phpunit-clever-and-smart 二次开发

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

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

lstrojny/phpunit-clever-and-smart

最新稳定版本:0.5.0

Composer 安装命令:

composer require lstrojny/phpunit-clever-and-smart

包简介

A clever test runner for PHPUnit

README 文档

README

Build Status Dependency Status Average time to resolve an issue Percentage of issues still open

Mission

Enable fast feedback cycles by storing test case results in a database and reorder tests on consecutive runs in the following order:

  1. Failures and errors
  2. So far unrecorded tests
  3. Remaining tests by execution time in ascendant order (fastest first)

It’s probably not yet very stable but try it out.

What it does

Run a test suite once with errors

PHPUnit 3.7.28 by Sebastian Bergmann.

.............................................FSFS..............  63 / 280 ( 22%)
............................................................... 126 / 280 ( 45%)
............................................................... 189 / 280 ( 67%)
............................................................... 252 / 280 ( 90%)
.........................

Rerun that test suite and see how the previous failing tests have been sorted to the beginning of the test run:

PHPUnit 3.7.28 by Sebastian Bergmann.

FSFS...........................................................  63 / 280 ( 22%)
............................................................... 126 / 280 ( 45%)
............................................................... 189 / 280 ( 67%)
............................................................... 252 / 280 ( 90%)
.........................

Installation

add the following line to your projects' composer.json require-dev section.

"lstrojny/phpunit-clever-and-smart": "0.*"

Configuration

To play around with it, add this to your phpunit.xml(.dist)

    <listeners>
        <listener class="PHPUnit\Runner\CleverAndSmart\TestListener">
            <arguments>
                <object class="PHPUnit\Runner\CleverAndSmart\Storage\Sqlite3Storage"/>
            </arguments>
        </listener>
    </listeners>

you might alter the location of the sqlite storage file, by passing a path to the Sqlite3Storage class:

    <listeners>
        <listener class="PHPUnit\Runner\CleverAndSmart\TestListener">
            <arguments>
                <object class="PHPUnit\Runner\CleverAndSmart\Storage\Sqlite3Storage">
                    <arguments>
                        <string>/my/path/to/.phpunit-cas.db</string>
                    </arguments>
                </object>
            </arguments>
        </listener>
    </listeners>

Roadmap

  • Test it with as many test suites as possible
  • Stabilize
  • Merge into PHPUnit core

统计信息

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

GitHub 信息

  • Stars: 169
  • Watchers: 6
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-01-12