What I do is I have my controllers fetch all their dependencies from the bootstrap and/or front controller. The most common example is to pull the db resource from the bootstrap:
// in controller
$db = $this->getInvokeArg(‘bootstrap’)->getResource(‘db’);
But I also take it a step further. For example, if I’m using data mappers, I have the action controller check […]
Giorgio Sironi writes an interesting TDD story; I am halfway through reading Growing object-oriented software, guided by tests, a book that teaches Test-Driven Development in a Java environment. A review will come soon, since the process described in this work is really language-agnostic and interesting also for php developers.
However, the book’s authors introduce a very […]
Matthew Turland has written a very nice article on Unit Testing using Zend_Test, Zend_Test_PHPUnit_DatabaseTestCase, Zend_Test_PHPUnit_ControllerTestCase where he uses a few interesting solutions. Definitely worth a read.
“I worked on a project recently where we used Zend Framework. As part of that project, I was tasked with writing unit tests. So, I went to the “tests” directory […]