Install PHPUnit to work with NetBeans in Windows

phpunit-logo-300x267PHPUnit 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.

  1. Install PEAR
    1. Download go-pear.phar
    2. Run
      php go-pear.phar
  2. Install PHPUnit
    1. If using a local installation, we should use pear.bat instead of pear
    2. pear clear-cache
      pear install -a -f phpunit/PHPUnit
  3. Install PHPUnit-SkeletonGenerator 
    pear install phpunit/PHPUnit_SkeletonGenerator
  4. Configure and check with NetBeans

Similar Posts

2 Comments

  1. 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

Leave a Reply

Your email address will not be published. Required fields are marked *