« Return to Thread: How to use PHPUnit in a MVC project

Re: How to use PHPUnit in a MVC project

by Ralf Eggert :: Rate this Message:

Reply to Author | View in Thread

Hi,

here are my two cents to this issue. For my tests I am using both
PHPUnit and the Simpletest webtester. When I started I devided my tests
into three groups:

a) Unit Tests (to test ACL, Models, Plugins, Setup, Routing, Framework
   components (my extensions), etc.)

b) Navi Tests (to test the navigation of the website, i.e. main
   menu, sub menu, page menu, context menu, etc.)

c) Web Tests (to test the content, forms and processing of my website,
   i.e. the complete registration process from calling the
   registration page and filling in the registration form until
   checking errors, sending mails and calling the activation link)

For a) I am using PHPUnit and for b) and c) the Simpletest webtester.
Both work like a charm for me. I was playing around with PHPUnits
Selenium extension but did not really like it.

Although I turned into a "test-first" maniac since I am developing with
the Zend Framework I am still highly productive. Since I reached nearly
100% test-covered code I have a high degree of trust into my code.
Whenever there is a new ZF release I only have to run my tests until all
of them work correctly again.

Ok, I am conscious that my code is not 100% bug free, because no code
will ever be 100% bug free. But since I started using the ZF and the
test-driven development approach I really have a better feeling.
Although it was quite hard in the beginning to stop hacking in some code
here and there without any written test for it.

Best Regards,

Ralf

 « Return to Thread: How to use PHPUnit in a MVC project