Unit Testing Zend Framework Applications

July 3rd, 2008

CodeUtopia has some thoughts on Unit Testing Zend Framework applications.

There are some good points made, particularly on the difficulty of realistically testing Controller classes:

Controller testing can be the most difficult part, and this is where you may need to perform some refactoring if your design is not suitable for testing. For example, you may have a lot of logic in your controllers, which might be better off in your models or library code. Testing the whole idea of getting out the correct output or redirects may be difficult.

Zend probably should have had a Unit Testing strategy when developing the Framework initially, but, as always, the community fills in the holes. This also highlights another problem developing PHP applications: there is no standard build process, in which scripts can be unit tested, compiled, optimized, packaged, etc. There are solutions available (Phing is popular, it’s even possible to use Ant) but this is an area where Zend could show real leadership and come up with their own industry-standard, solution (maybe even as part of the Zend Framework, or Zend Studio). I’m not holding my breath, but you never know.

Debugging PHP in Eclipse PDT

June 18th, 2008

IBM has posted a new tutorial on the developerWorks site showing you how to debug PHP using the Eclipse PHP Developer Tools (PDT) plugin. Check out the article here (note: you need an IBM ID to view the full tutorial).