chartjes / tricorder
此软件包最新版本(dev-master)的许可证信息不可用。
描述文本
dev-master
2015-03-31 15:22 UTC
Requires
- nikic/php-parser: 1.0.*@dev
- phpdocumentor/phpdocumentor: 2.0.*
- symfony/console: 2.*
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-14 16:08:30 UTC
README
(标志由 Jacques Woodcock 赞助创建)
PHP-Tricorder 是一个 CLI 工具,用于扫描使用 phpDocumentor 创建的结构文件,并就代码中潜在的问题以及测试策略信息提供建议。
执行 /path/to/php tricorder.php
将提供一些使用信息。
请阅读此代码中包含的 LICENSE 文件以获取许可详情。
如何使用
- 使用您首选的方法安装 phpDocumentor
- 使用 docblocks 描述您的方法的参数和返回类型
- 要递归地生成整个目录的结构.xml 文档,请使用
phpdoc parse -d . -t
- 要为特定文件生成结构.xml 文档,请使用
phpdoc parse -f /path/to.file -t
- 使用 Composer 安装依赖项
/path/to/php composer.phar install
- 使用 tricorder 处理结构.xml 文档:
/path/to/php tricorder.php /path/to/structure.xml
Tricorder 将为您提供一些关于测试类时要注意的事项的建议。以下是一些示例输出
chartjes@php-vm:~/php-tricorder$ php tricorder.php ../building-testable-applications/lib/IBL/structure.xml
Reading in phpDocumentor structure file...
FranchiseMapper.php
Scanning FranchiseMapper
__construct -- mock $conn as \PDO
createFranchiseFromRow -- test $row using an empty array()
delete -- mock $franchise as \IBL\Franchise
findAll -- test method returns \IBL\Franchise instances
findByConference -- test $conference using null or empty strings
findByConferenceDivision -- test $conference using null or empty strings
findByNickname -- test $nickname using null or empty strings
findById -- test $id using non-integer values
generateMap -- test $teamsTable using null or empty strings
save -- mock $franchise as \IBL\Franchise
_insert -- non-public methods are difficult to test in isolation
_insert -- mock $franchise as \IBL\Franchise
_update -- non-public methods are difficult to test in isolation
_update -- mock $franchise as \IBL\Franchise
\IBL\Franchise might need to be injected for testing purposes
\Exception might need to be injected for testing purposes
\Exception might need to be injected for testing purposes
\Exception might need to be injected for testing purposes
\Exception might need to be injected for testing purposes
\Exception might need to be injected for testing purposes
随时在 Twitter 上联系我,并且总是欢迎提交拉取请求来改进此工具。