Test Driven Development and xUnit seem to be popular among many of the professional and very public programmers, so I thought I might like to give it a whirl and see if I can improve the flexibility of my source code and better decouple objects. Unfortunately, I use WAMPServer on Windows as a development server while at work so directions for installing PHP related plugins/PEAR aren’t exactly identical. (Usually, I can figure it out fairly quickly.)
Installing WAMPServer is fairly quick and well documented online, so I won’t cover it specifically although I will mention I am using WAMPServer v2 at time of this writing. I will also assume that you have used the default file paths of “C:wamp” and “C:wampwww”
Steps to installing PHPUnit:
- Install PEAR if you haven’t already by opening up a new command window and entering the following commands
cd wampbinphpphp5.3.0
go-pear.bat
- Press enter when the list of directories appears
- When asked if you want PHP.ini to be modified press Y and then enter.
- You will be told the include path is updated. Press enter.
- You be will be told PEAR_ENV.reg has been created.
PEAR_ENV.reg
- Pear is installed, but it isn’t the newest version of the updater, so we should update because PHPUnit requires at least PEAR Updater 1.8.1
pear update-channels
- Thankfully, we are nearly done our journey. We simply need to add a channel to PEAR and then we can install!
pear channel-discover pear.phpunit.de
pear install –alldeps phpunit/PHPUnit
Good luck testing and keep checking back to see how to test!
7 responses to “Installing PHPUnit on WAMPServer”
Small problem: http://imgur.com/jeeMy.png
I haven’t ever seen the error you mentioned, but you should be able to follow these directions: PHP 5.3 Windows & Pear
Alright, that worked.
One thing I don’t get is the locations. PEAR asks for the location of the “Public Web Files Directory”
As far as I know, that’s “Cwampwww”
I’m not sure, but I did change it from the suggested path. What’s up with those anyway?
I’m glad to hear that worked. If you don’t mind me asking, where did you install?
In the pear folder itself.
C:wampbinphpphp5.3.0PEAR
So under that folder, all the stuff was downloaded.
Sadly, haven’t tested anything yet.
I tried installing it on a Virtual Machine, but now I feel like having my questions answered.
I posted this on Stackoverflow: http://stackoverflow.com/questions/3224848/