prolic / humus-phpunit-module
PHPUnit Module for Zend Framework 2
Installs: 2 635
Dependents: 1
Suggesters: 0
Security: 0
Stars: 23
Watchers: 3
Forks: 7
Open Issues: 1
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 is a Module for Zend Framework 2 for unit testing. It is able to test all your zf2 modules and libraries at once.
If you install this module via composer, you will get phpunit installed via composer in your vendor directory, too. You don't have to have a running PHPUnit installation in your system, it will be installed as dependency.
You can also download and test the Humus PHPUnit Module Sample Application at https://github.com/prolic/HumusPHPUnitModuleSampleApp
UPDATES IN 1.2.0
- Full ZF2 cli integration: You can start humusphpunit with "php public/index.php humusphpunit" The old way of "vendor/bin/humusphpunit" still works
- Support for passing parameters to phpunit like: "--strict", "--debug", "--version", and so on.
- Support for new parameters specific to HumusPHPUnitModule like: "--modules=" and "stop-on-module-failure"
- Get list of available options with: "php public/index.php" or "php public/index.php humusphpunit --help"
- Colorized output in console
- Test coverage
UPDATES IN 1.1.0
- Remove PHPUnitListener - ATTENTION: THIS IS A BC BREAK !!! You have to configure humus phpunit module with your module config from now on.
- Remove dependency on EHER/PHPUnit, because PHPUnit now handles composer installation himself.
- Remove dependency on complete Zend Framework 2, instead the required components are defined as dependency.
Dependencies
- PHP 5.3.3
- Zend Console (from ZF2)
- Zend Json (from ZF2)
- Zend ModuleManager (from ZF2)
- Zend MVC (from ZF2)
- Zend Text (from ZF2)
- Any application similar to the ZendSkeletonApplication or HumusMvcSkeletonApplication
- PHPUnit 3.7.*
Suggestions
Installation
- Add
"prolic/humus-phpunit-module": "1.*"
to yourcomposer.json
- Run
php composer.phar install
- Enable the module in your
config/application.config.php
by addingHumusPHPUnitModule
tomodules
Usage
php public/index.php humusphpunit
or
./vendor/bin/humusphpunit
get help
php public/index.php humusphpunit --help
or
php public/index.php
Configuration
Sample configuration:
<?php
return array(
'humus_phpunit_module' => array(
'phpunit_runner' => array(
'Doctrine\Common' => array(
'vendor/doctrine/common/phpunit.xml.dist'
)
)
)
);