Installing PHPUnit with MAMP and Eclipse
Monday, 2 February, 2009
Had a case the other day to install PHPUnit for Eclipse. Googled it a bit, but found no good examples.
Anyway here is how you do it:
- Go to this address http://pear.phpunit.de/get/
- There, you can download the latest version of PHPUnit. For me it was PHPUnit-3.3.9.tgz
- Extract then the folder structure will look something like this:
- Place PHPUnit folder and pear-phpunit file: / Applications/MAMP/bin/php5/lib/php /
- Open pear-phpunit in your favorite editor and replace all @ @ php_bin with / Applications/MAMP/bin/php5/bin/php
- Then open the PHPUnit / Util / Fileloader.php to replace @ @ with php_bin / Applications/MAMP/bin/php5/bin/php
- Then go into eclipse to open the External Tools Configuration
- Create a new configuration that looks like this:
- Finally you must edit the php.ini file located in / Applications/MAMP/conf/php5
- include_path must contain the path to your project in eclipse, for example:
- include_path = ".: / Applications/MAMP/bin/php5/lib/php: / Users / Geir / Documents / Development / Project PHP / src / main / php"
- Go into eclipse, click once in the window with the tests and run the External Tools config you made
Good luck!
Categories → PHP





This works really well. But you must remember to restart eclipse after config.