edsonmedina/php_testability
Composer 安装命令:
composer require --dev edsonmedina/php_testability
包简介
Analyses and reports testability issues of a php codebase
README 文档
README
PHP_Testability
Analyses and produces a report with testability issues of a php codebase.
Installation
PHP_Testability requires at least PHP 7.0 to run.
Composer
Add edsonmedina/php_testability as a dependency to your project's composer.json file if you use Composer to manage the dependencies of your project.
{
"require-dev": {
"edsonmedina/php_testability": "dev-master"
}
}
And run composer update.
Or alternatively, just run:
composer require edsonmedina/php_testability "dev-master"
Usage
Analyse the current directory and generate an HTML report into report/
vendor/bin/testability . -o report
Exclude some directories
vendor/bin/testability . -x vendor,tmp,upload,config -o report
Check all the available options.
vendor/bin/testability --help
Results
Open report/index.html on your browser. You shoule see something like this:
If you click on a file with issues, it'll show you a code browser and will highlight the lines with issues.
These are issues that hinder testability, such as:
- references to global variables, super globals, etc
- calls to functions that can't be mocked (like static methods or global functions)
newinstances of objects (tight coupling - can't be mocked/injected)- ...and much more
Kudos to the brilliant PHP-Parser (by nikic) on which PHP_Testability relies heavily.
统计信息
- 总下载量: 142.16k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 133
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0
- 更新时间: 2014-10-07