Install PHPUnit with XAMPP
This method is now deprecated per Sebastian Bergmann. Use the phar or composer method to install PHPUnit.
1. First get and install XAMPP: http://www.apachefriends.org/en/xampp.html
Now after the install, usually you'll have your files under something like c:\xampp\php, etc. This works pretty well, but to get PHPUnit, you need PEAR which needs some additional install.
2. Get the latest PEAR update and run the PEAR installer:
download the file at http://pear.php.net/go-pear.phar and place it in your C:\xampp\php folder
3. Change the location of your pear.ini (item#11 or 12 - the menu varies according to your system) to C:\xampp\php - This is especially important on Windows 7 that protects the windows folder. If this is not changed your PEAR install will not be able to save its configuration files.
cd \xampp\php php go-pear.phar
4. Run the C:\xampp\php\PEAR_ENV.reg file created to import your PEAR environment variable settings.
5. Log out of Windows and back in - This will load the new environment variables into memory (otherwise the old location for pear.ini will be used). Confirm your settings by running:
It should now read: C:\xampp\php\pear.ini
6. Install PHPUnit & Skeleton Generator through PEAR
7. Check your version of PHPUnit - It should be at least version 3.6.x
pear config-set auto_discover 1 pear install pear.phpunit.de/PHPUnit pear install phpunit/PHPUnit_SkeletonGenerator
phpunit --versionYou should also now have phpunit-skelgen.bat in the C:\xampp\php folder.
If this blog was helpful to you, please thank me by clicking on the google +1 link. Every time you click +1 a unicorn gets its wings... and what's cooler than a flying unicorn?
First of all, if you are trying to use Netbeans to do unit testing in PHP, then you should probably start at the great tutorial at: http://netbeans.org/kb/docs/php/phpunit.html#installing-phpunit
The PEAR install method is now at end of life and can no longer be used according to Sebastian Bergmann's github page.
Try this method for using the phar install method: Phar install method.