prolic / humus-phpunit-module
此包已被弃用,不再维护。未建议替代包。
Zend Framework 2 的 PHPUnit 模块
1.1.4
2014-07-07 16:50 UTC
Requires
- php: >=5.3.3
- phpunit/phpunit: >=3.7.0
- zendframework/zend-console: 2.*
- zendframework/zend-json: 2.*
- zendframework/zend-modulemanager: 2.*
- zendframework/zend-mvc: 2.*
- zendframework/zend-text: 2.*
Requires (Dev)
- phpunit/phpunit: >=3.7.0
- satooshi/php-coveralls: dev-master
- squizlabs/php_codesniffer: 1.5.*
Suggests
- claylo/selenium-server-standalone: Composer distribution of Selenium Server Standalone, the browser automation framework.
- phpmd/phpmd: PHP Mess Detector
- phpunit/dbunit: DbUnit port for PHP/PHPUnit to support database interaction testing.
- phpunit/phpunit-selenium: Selenium Server integration for PHPUnit
- phpunit/phpunit-story: Story extension for PHPUnit to facilitate Behaviour-Driven Development.
README
Humus PHPUnit Module 是一个用于 Zend Framework 2 的单元测试模块。它可以一次性测试所有您的 zf2 模块和库。
如果您通过 composer 安装此模块,您也会在 vendor 目录中通过 composer 安装 phpunit。您不需要在系统中有一个运行的 PHPUnit 安装,它将作为依赖项安装。
您还可以在 https://github.com/prolic/HumusPHPUnitModuleSampleApp 下载并测试 Humus PHPUnit Module 示例应用程序。
1.2.0 版更新
- 完整的 ZF2 cli 集成:您可以通过 "php public/index.php humusphpunit" 来启动 humusphpunit。旧的 "vendor/bin/humusphpunit" 方法仍然有效。
- 支持传递参数到 phpunit,如:"--strict","--debug","--version",等等。
- 支持 HumusPHPUnitModule 特定的新参数,如:"--modules=" 和 "stop-on-module-failure"。
- 使用 "php public/index.php" 或 "php public/index.php humusphpunit --help" 来获取可用选项的列表。
- 控制台输出着色
- 测试覆盖率
1.1.0 版更新
- 移除 PHPUnitListener - 注意:这是一个不兼容的更改!!!您必须从现在开始使用模块配置来配置 humus phpunit 模块。
- 移除对 EHER/PHPUnit 的依赖,因为 PHPUnit 现在自行处理 composer 安装。
- 移除对完整 Zend Framework 2 的依赖,相反,所需的组件被定义为依赖项。
依赖项
- PHP 5.3.3
- Zend Console (来自 ZF2)
- Zend Json (来自 ZF2)
- Zend ModuleManager (来自 ZF2)
- Zend MVC (来自 ZF2)
- Zend Text (来自 ZF2)
- 任何类似ZendSkeletonApplication 或 HumusMvcSkeletonApplication 的应用程序
- PHPUnit 3.7.*
建议
安装
- 将
"prolic/humus-phpunit-module": "1.*"
添加到您的composer.json
- 运行
php composer.phar install
- 通过在
config/application.config.php
中添加HumusPHPUnitModule
到modules
来启用模块
使用方法
php public/index.php humusphpunit
或
./vendor/bin/humusphpunit
获取帮助
php public/index.php humusphpunit --help
或
php public/index.php
配置
示例配置
<?php
return array(
'humus_phpunit_module' => array(
'phpunit_runner' => array(
'Doctrine\Common' => array(
'vendor/doctrine/common/phpunit.xml.dist'
)
)
)
);