Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse PDT & PHPUnit?

People also ask

Is Eclipse good for PHP?

A: Eclipse for PHP works really great with CodeIgniter. Netbeans is another good IDE, and Sublime is a good code editor for CodeIgniter.


See Eclipse Plugin PHP Tool Integration (PTI) which provides integration of following features for Eclipse:

  • PHP_CodeSniffer
  • PHPUnit
  • PHP Depend
  • PHP Copy/Paste Detector

Update sites (Help - Install Software - Add ...):

Latest stable release: http://www.phpsrc.org/eclipse/pti/

Development version: http://www.phpsrc.org/eclipse/pti-dev/


We've developed an Eclipse plugin called MakeGood that integrates PHPUnit and more testing frameworks with Eclipse PDT.

MakeGood is a continuous test runner to run unit tests on Eclipse PDT.

MakeGood provides fast feedback by automated workflows for running tests, tracking failures and errors and fatal errors. This will help developers to do Test Driven Development (TDD) and Continuous Testing.

For more information, visit our website at: https://github.com/piece/makegood/wiki

A screenshot of MakeGood


It is possible to integrate PHPUnit with PDT in a simple way (these settings aren't fully generic but should be a good starting point).

  1. Select the Run > External Tools > External tools configurations
  2. Create a new program
  3. Set the Location to point to your executable (/usr/bin/phpunit on linux)
  4. Set the Working Directory to use the variable ${workspace_loc}
  5. Set the Arguments to ${resource_path}

Now select Run > External Tools > PHPUnit to execute the selected test file. This simply executes phpunit and sends STDOUT to the Eclipse terminal. Simple but effective.

Subsequently, you can use the icon with a green arrow and red toolbox to run PHPUnit without having to navigate the menus.


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.