News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Brandon Savage's Blog:
Interfaces Make Testing Easier
May 26, 2010 @ 09:54:20

In a new post to his blog Brandon Savage writes about a method he's found to make testing Zend Framework applications simpler - specifically in implementing the right interfaces to get the job done.

The unfortunate thing is that more PHP developers don't implement interfaces when they could or should. They prefer to implement abstract or concrete classes and extend from there; however, interfaces offer three distinct advantages over inheritance in [the case of testing a Zend_Auth part of your application].

He gives a few reasons why interfaces should be used including the fact that more than one can be implemented at once, that they make mocking objects easy and that, since it defines most of the API up front, you can know that those methods will be there in the inheriting classes.

1 comment voice your opinion now!
interface unittest zendframework opinion


blog comments powered by Disqus

Similar Posts

David Abdemoulaie's Blog: bundle-phu - minify, bundle, and compress your js/css in Zend Framework

Developer Tutorials Blog: Testing email routines in web applications

Lee Blue's Blog: What's The Best PHP Framework?

Mauricio Cuenca's Blog: Two (or more) Zend Framework projects on a shared host

Gergely Hodicska's Blog: Extending Zend_Acl to support custom roles and resources


Community Events





Don't see your event here?
Let us know!


release experience interview introduction symfony2 series opinion laravel refactor community testing install language developer podcast unittest list framework code threedevsandamaybe

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework