Tag Archive

Testing Zend Framework controllers in isolation

Published on 11 August, 2010 By Danny Froberg

What I do is I have my con­trollers fetch all their depen­den­cies from the boot­strap and/or front con­troller. The most com­mon exam­ple is to pull the db resource from the bootstrap:

// in con­troller
$db = $this->getInvokeArg(‘bootstrap’)->getResource(‘db’);

But I also take it a step fur­ther. For exam­ple, if I’m using data map­pers, I have the action con­troller check […]

Acceptance Test-Driven Development

Published on 26 May, 2010 By Danny Froberg

Gior­gio Sironi writes an inter­est­ing TDD story; I am halfway through read­ing Grow­ing object-oriented soft­ware, guided by tests, a book that teaches Test-Driven Devel­op­ment in a Java envi­ron­ment. A review will come soon, since the process described in this work is really language-agnostic and inter­est­ing also for php devel­op­ers.
How­ever, the book’s authors intro­duce a very […]

Getting Started with Zend_Test

Published on 14 January, 2010 By Danny Froberg

Matthew Tur­land has writ­ten a very nice arti­cle on Unit Test­ing using Zend_Test, Zend_Test_PHPUnit_DatabaseTestCase, Zend_Test_PHPUnit_ControllerTestCase where he uses a few inter­est­ing solu­tions. Def­i­nitely worth a read.
“I worked on a project recently where we used Zend Frame­work. As part of that project, I was tasked with writ­ing unit tests. So, I went to the “tests” directory […]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes