jimmyoak/phpunit-test-checker
Composer 安装命令:
composer require --dev jimmyoak/phpunit-test-checker
包简介
README 文档
README
Description
Check for classes without tests. Intended for pre-commit hook.
Usage
Config file example (phpunit-test-checker.json):
{
"suites": [
{
"src-path": "src/",
"test-path": "test/",
"test-case-suffix": "Test"
}
]
}
Read config and check for classes with no tests:
use JimmyOak\PhpUnitChecker\Checker\Checker; require_once __DIR__ . '/vendor/autoload.php'; $checker = new Checker(\JimmyOak\PhpUnitChecker\Config\JsonConfigReader::readFile(__DIR__ . '/phpunit-test-checker.json')); $checker->check();
Output:
Classes with no tests:
- Checker/Checker.php
- Command/CheckerCommand.php
But if we run with this config...:
{
"suites": [
{
"src-path": "src/",
"test-path": "test/",
"test-case-suffix": "Test",
"excluded": [
"Checker/Checker.php",
"Command/"
]
}
]
}
Outputs nothing :)
"Excluded" is just a regex like /^Command/, therefore if it's a folder put the / separator at the end.
TODO
A lot of improvements. This is only an approach. (Proof of concept)
统计信息
- 总下载量: 2.5k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-01-21