2017 © Pedro Peláez
 

library phpunit-smartrunner

CLI tool that runs only necessary TestCases.

image

iakio/phpunit-smartrunner

CLI tool that runs only necessary TestCases.

  • Sunday, August 21, 2016
  • by iakio
  • Repository
  • 1 Watchers
  • 1 Stars
  • 119 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

phpunit-smartrunner

Build Status, (*1)

smartrunner resolves dependencies between SUTs and test cases by code coverage data using phpdbg or xdebug., (*2)

  • When smartrunner is invoked with an argument CalcTest.php, it runs CalcTest.php test case.
  • When smartrunner is invoked with an argument Calc.php, it also runs CalcTest.php. Additionally, it may run all test cases related to Calc.php.

Install

$ composer require --dev iakio/phpunit-smartrunner:dev-master

Usage

$ vendor/bin/smartrunner init

This creates .smartrunner/phpunit.xml.dist file. If you already have some test codes, and you want to store all dependencies between SUTs and tests certainly, you can run phpunit with this file., (*3)

$ vendor/bin/phpunit -c .smartrunner/phpunit.xml.dist tests

Then, run smartrunner from your favorite IDE, editor or filesystem watcher., (*4)

$ vendor/bin/smartrunner run src/Calc.php

Setting Examples

gomon

> gomon -m=\.php$ -R -F -- vendor\bin\smartrunner run

watchy

$ watchy -w . -- bash -c 'vendor/bin/smartrunner run $FILE'
or
> watchy -w . -- cmd /C "vendor\bin\smartrunner run %FILE%"

grunt

module.exports = function (grunt) {
    grunt.initConfig({
        shell: {
            smartrunner: {
                file: "",
                command: function () {
                    return "vendor/bin/smartrunner run " +
                        grunt.config.get('shell.smartrunner.file');
                }
            }

        },
        esteWatch: {
            options: {
                dirs: [
                    'src/**/',
                    'tests/**/',
                ]
            },
            php: function (filePath) {
                grunt.config("shell.smartrunner.file", filePath);
                return ['shell:smartrunner'];
            },
        },
    });
    grunt.loadNpmTasks('grunt-este-watch');
    grunt.loadNpmTasks('grunt-shell');
};

Configuration

If you want to use phpunit.phar, change your .smartrunner/config.php:, (*5)

<?php
return function ($config) {
    $config["phpunit"] = "php phpunit.phar";
    $config["ignore"] = [
        "vendor\/**\/*"
    ];
};

Requirement

  • php >= 5.4
  • phpdbg or xdebug

License

This software is released under the MIT License., (*6)

The Versions

21/08 2016

dev-master

9999999-dev

CLI tool that runs only necessary TestCases.

  Sources   Download

MIT

The Requires

 

The Development Requires

by ISHIDA Akio

tdd phpunit

19/08 2016

dev-refactor

dev-refactor

CLI tool that runs only necessary TestCases.

  Sources   Download

MIT

The Requires

 

The Development Requires

by ISHIDA Akio

tdd phpunit

30/07 2016

dev-behat-tags

dev-behat-tags

CLI tool that runs only necessary TestCases.

  Sources   Download

MIT

The Requires

 

The Development Requires

by ISHIDA Akio

tdd phpunit

26/07 2016

0.4.0

0.4.0.0

CLI tool that runs only necessary TestCases.

  Sources   Download

MIT

The Requires

 

The Development Requires

by ISHIDA Akio

tdd phpunit

05/12 2015

0.3.0

0.3.0.0

CLI tool that runs only necessary TestCases.

  Sources   Download

MIT

The Requires

 

The Development Requires

by ISHIDA Akio

tdd phpunit

01/11 2015

0.2.0

0.2.0.0

CLI tool that runs only necessary TestCases.

  Sources   Download

MIT

The Requires

 

The Development Requires

by ISHIDA Akio

tdd phpunit

10/10 2015

0.1.0

0.1.0.0

CLI tool that runs only necessary TestCases.

  Sources   Download

MIT

The Requires

 

The Development Requires

by ISHIDA Akio

tdd phpunit