Unit Testing

Testing Zend Framework controllers in isolation

Posted by Danny Froberg on 11 August, 2010 at 12:12 pm

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 boot­strap: // 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 […]

Acceptance Test-Driven Development

Posted by Danny Froberg on 26 May, 2010 at 10:38 pm

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 […]

PHP Best Practices — Matthew Weier O’Phinney and Lorna Jane Mitchell">Talk: PHP Best Practices — Matthew Weier O’Phinney and Lorna Jane Mitchell

Posted by Danny Froberg on 20 May, 2010 at 3:16 am

Writ­ing main­tain­able code is an art that takes effort and prac­tice to mas­ter. Part of that art is learn­ing what tools and strate­gies will assist you in that effort. In this tuto­r­ial, we will cover a vari­ety of prac­tices and tools that can make your life, and the lives of your team mem­bers, eas­ier as […]

PHP Continuous Integration with Atlassian Bamboo">PHP Continuous Integration with Atlassian Bamboo

Posted by Danny Froberg on 2 March, 2010 at 5:11 am

Mike Will­banks writes; Con­tin­u­ous inte­gra­tion is all the rage these days; you are unit test­ing your code are you not? Dur­ing some con­sult­ing in Jan­u­ary with the help of Sebas­t­ian Bergmann, from thePHP.cc, we setup con­tin­u­ous inte­gra­tion uti­liz­ing Atlass­ian Bam­boo and received train­ing on PHPUnit. Using Atlass­ian Bam­boo for con­tin­u­ous inte­gra­tion will take you a […]

Getting Started with Zend_Test

Posted by Danny Froberg on 14 January, 2010 at 3:00 pm

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 […]

PHP — phpUnderControl & CruiseControl">Continuous Integration for PHP — phpUnderControl & CruiseControl

Posted by Danny Froberg on 3 January, 2010 at 6:23 pm

Did you know that you can auto­mate unit tests (which is the PHP worlds equalient of com­pi­la­tion checks :-) ).

Set up your devel­op­ment team using local check­outs of the project and have them do local PHPUnit tests, check their changes in and then get Con­tin­u­ous Inte­gra­tion checks done on a cen­tral server using phpUn­der­Con­trol that emails the team with success/fail reports, it’s a good way to work.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes