Steps to Install PEAR and PhpUnit On WAMP with NetBeans

Steps to Install PEAR and PhpUnit On WAMP with NetBeans

1) Locate the "php.ini" file. In my case, I found it at this path:
c:\wamp\bin\php\php5.3.0\php.ini

2) Find the following line:
;phar.require_hash = On

Uncomment the ";phar.require_hash = On" line by removing the semi-colon.

Change "On" to "Off".
phar.require_hash = Off


3) Download go-pear.phar from http://pear.php.net/manual/en/installation.getting.php save in php5.3.0 folder

4) Download PHPUNIT from https://github.com/sebastianbergmann/phpunit/downloads
copy phpunit.bat and paste it in php5.3.8 folder
 
5) In Command Prompt Type
php go-pear.phar
Type local put the paths wrt php5.3.8 and continue
 
6) A few More Commands before Your Netbeans understands that you have upgraded version of Phpunit on your machine

pear upgrade pear
pear channel-discover components.ez.no
pear channel-discover pear.phpunit.de
pear install --alldeps phpunit/PHPUnit

pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
 
7) Go to Netbeans select tools->options->php->unit testing , select the phpunit.bat file which we put in php folder at step4
If netbeans is not giving you any error means you are done with phpunit installation with netbeans

8) For reference on how to start with writing testcases Visit :
http://netbeans.org/kb/docs/php/phpunit.html#installing-phpunit
http://www.phpunit.de/manual/current/en/writing-tests-for-phpunit.html


Cheers



Comments