The WebApp Wizard Web development made magical


PHPUnit / Zend Studio 7 configuration

Everybody knows about unit testing. Some people know about PHPUnit, a unit testing library for PHP. There are people who tried it, and among those, people who where disappointed because they didn't manage to get it to work.

Well, I almost fell into this last category. But then I found the solution.

If, like me, you're using Zend Studio, that's no big deal, really. But here are a few pointers that might help you achieving your goal.


Zend Debugger configuration

One of the great things about Zend Studio is the integration of powerful tools like the Zend Debugger or the Profiler. But, in order to take full advantage of the IDE, there is some configuration to do.

Zend Debugger will allow you not only to debug your PHP code, of course, but will also allow you to profile your code. Profiling consists of measuring the time spent in each portion of your code. That means you will be able to know that you spend 200 milliseconds in function a(), then 700 milliseconds in function b(), then 32 milliseconds in function c(). You will also know that you didn't spend any time in function d(). Yes, you will be able to see which portions of your code are unused. And that's pretty cool.