Is there any integration of PHPUnit with Eclipse PDT?
If not, are there any plans to do so?
For all using composer on unix like machine (eclipse and xdebug installed):
cd <project-root>
ln -s vendor/bin/phpunit phpunit.php
Open eclipse, open run/debug configuration, create a new debug configuration, and select phpunit.php
as file to debug. Continue the rest of the setup as usual, set breakpoints, that's it.
Sebastian Bergmann did approach pdt back in 2006... but with no obvious result.
And his latest entries on his blog only mention PHPEdit 2.12 and Zend Studio.
The only testing framework officially documented on the PDT side is the "PDT Testing Framework", and it does not seem actively maintained...
So, no. There does not seem to be any plan to actively integrate PHPUnit in PDT anytime soon.
Following @DavidWinterbottom response (Eclipse Indigo):
Select the Run -> External Tools -> External tools configurations
Create a new program
Set the Location to point to your executable (/usr/bin/phpunit
on Linux, or path to phpunit.bat
on Windows)
Set the Arguments to absolute path to your phpunit
folder (C:\phpproject\testunit
)
I couldn't make get it to using ${project_loc}
or ${project_path}
.
I tried PHP Unit in Eclipse and was not happy with the configuration issues. I switched to NetBeans PHP IDE. I recommend NetBeans PHP IDE for PHP Unit testing. http://www.netbeans.org/kb/docs/php/phpunit.html
See Eclipse Plugin PHP Tool Integration (PTI) which provides integration of following features for Eclipse:
Update sites (Help - Install Software - Add ...):
Latest stable release: http://www.phpsrc.org/eclipse/pti/
Development version: http://www.phpsrc.org/eclipse/pti-dev/
Using phpunit from Ant also is possible, and Ant is natively supported by Eclipse. Simple have a new <exec executable="phpunit">
in a target and voilà, you can use phpunit in eclipse, through ant.