Question

I have a requirement that I need to run the tests through commandline as well as through a graphical debugger. The graphical debugger should run the code on Apache.

I tried SimpleTest and it works well as in both the cases but PHPUnit only works on commandline. I am using NuSphere PhpED to debug and I am not able to make phpunit to run.

When I run Simpletest from editor it runs as php command but PHPUnit will have to run through $phpunit command. I am not able to understand how will that work.

There is a php debugger module on Apache using which I can step through the code with simpletest. Is there any debugger module for PHPUnit?

My server is Linux but my editor is on windows. Is it possible to run tests like this?

Is it also possible to run PHPUnit without installing through PEAR and just like Simpletest - where we just copied the folder and included the autorun file.

I am new to both these tools and I need to decide which one to use and integrate with Hudson/Maven.

Please guide me as I am new to these.

Thanks Sumit

Was it helpful?

Solution

We migrated from SimpleTest to PHPUnit a little over a year ago and have been very happy. SimpleTest is abandoned while PHPUnit is actively developed with regular releases and a plan for the future. We run PHPUnit on Ubuntu and Windows machines both from the command line and in NetBeans IDE even though our application is a CMS running behind Apache.

For continuous integration, check out Templates for Jenkins Jobs for PHP Projects. It has integration of PHPUnit for testing as well as PHPMD, PHPCPD, PHP Depend, PHPLOC, and PHP CodeSniffer.

I can't completely answer your original question regarding running PHPUnit in a web debugger. You could install PHPUnit using PEAR and check out the script that runs it. It's all PHP except for the initial shell script, but with a little work you could write a similar script in PHP that sets up your environment and calls an appropriate TestRunner.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top