PHPUnit is the de-facto standard for unit testing in PHP projects. It provides both a framework that makes the writing of tests easy as well as the functionality to easily run the tests and analyse their results.
- Install PEAR
- Download go-pear.phar
- Run
php go-pear.phar
- Install PHPUnit
- If using a local installation, we should use pear.bat instead of pear
pear clear-cache pear install -a -f phpunit/PHPUnit
- Install PHPUnit-SkeletonGenerator
pear install phpunit/PHPUnit_SkeletonGenerator
- Configure and check with NetBeans
2 thoughts on “Install PHPUnit to work with NetBeans in Windows”
Step 2 fails with:
c:\php5>pear install -a -f phpunit/PHPUnit
Attempting to discover channel “phpunit”…
Attempting fallback to https instead of http on channel “phpunit”…
unknown channel “phpunit” in “phpunit/PHPUnit”
invalid package name/package file “phpunit/PHPUnit”
install failed
Execute:
pear channel-discover pear.phpunit.de
Before
pear install -a -f phpunit/PHPUnit