[ciapug] Resources from last night's talk
Eric Junker
eric at eric.nu
Wed Oct 3 10:16:24 CDT 2007
Matthew Nuzum wrote:
> found. I've just not been able to grasp how to go from the "hello
> world" of testing to building it into my application. Especially web
> applications, since there's little mention of unit testing for the
> web.
I believe several PHP frameworks include a unit testing framework. For
example, Symfony has one called lime. Other popular unit test frameworks
for PHP are: PhpUnit and Simpletest. I used SimpleTest on my last
project and found it very useful. For every bug I found I wrote a unit
test to make sure I never had that bug again. Unit testing also allows
you to refactor and be confident that you didn't break anything.
For unit testing an MVC app I think the most important thing to test is
the models. Some say that a true unit test should not touch the database
so they use test fixtures or mock objects to decouple the test from the
database.
Eric
More information about the ciapug
mailing list