views:

266

answers:

3

Is it possible to run PHP Zend test cases (those that extend Zend_Test_PHPUnit_ControllerTestCase, etc.) through Eclipse PDT?

I would like to be able to run them in a similar fashion as you run JUnit tests in Eclipse, by right-clicking the test file and selecting "Run as a JUnit test case."

I'd love to see the green or red bar instead of having to go to the command line :).

Thanks in advance.

A: 

Take a look into the SimpleTest plugin for Eclipse, it has PHPUnit support although I cannot verify if it works or not:

http://www.simpletest.org/

You run tests similarly to JUnit via "Run as SimpleTest", and there is a JUnit-like result view.

Guruno
+1  A: 

I have never been able to get the SimpleTest Eclipse plugin to work with PHPUnit based tests, though it's theoretically possible. You can get PHPUnit to run in the Eclipse IDE, but it's in a way that just dumps output to the console. At least, you don't have to leave the IDE then, although you don't get nice red/green reports. If anyone can extend the damn SimpleTest plugin to include PHPUnit, I'd like to hear about it.

Sam McAfee
A: 

You can use the PHPUnit component of the PTI Eclipse plugin: http://www.phpsrc.org/projects/pti-phpunit/wiki/

It will provide you with a test generator, simple ways to run tests and code highlighting to see which test failed where.

christian studer