iakio/phpunit-smartrunner
最新稳定版本:0.4.0
Composer 安装命令:
composer require iakio/phpunit-smartrunner
包简介
CLI tool that runs only necessary TestCases.
README 文档
README
smartrunner resolves dependencies between SUTs and test cases by code coverage data using phpdbg or xdebug.
- When
smartrunneris invoked with an argumentCalcTest.php, it runsCalcTest.phptest case. - When
smartrunneris invoked with an argumentCalc.php, it also runsCalcTest.php. Additionally, it may run all test cases related toCalc.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.
$ vendor/bin/phpunit -c .smartrunner/phpunit.xml.dist tests
Then, run smartrunner from your favorite IDE, editor or filesystem watcher.
$ 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:
<?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.
统计信息
- 总下载量: 129
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-23