News Feed
Sections




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

Fabien Potencier's Blog:
Create your own framework... on top of the Symfony2 Components (part 8)
January 17, 2012 @ 09:39:26

Fabien Potencier has posted the eighth part in his "building a framework on Symfony2 components" series. So far he's created a full-featured microframework with routing, controllers, HTTP handling and namespaced code. In this latest part he improves the sample framework by adding some unit tests.

Some watchful readers pointed out some subtle but nonetheless important bugs in the framework we have built yesterday. When creating a framework, you must be sure that it behaves as advertised. If not, all the applications based on it will exhibit the same bugs. The good news is that whenever you fix a bug, you are fixing a bunch of applications too. Today's mission is to write unit tests for the framework we have created by using PHPUnit.

He includes the XML for a basic phpunit.xml configuration file and uses a UrlMatcher and ControllerResolver in a "Framework" class and makes the test check for "not found" URLs and for checking for a correct Response.

0 comments voice your opinion now!
symfony2 framework custom components tutorial series unittest


blog comments powered by Disqus

Similar Posts

Rob Allen's Blog: Using Zend\Loader\Autoloader

Stefan Mischook's Blog: Note to CodeIgniter nerds: please, no looping code in your views.

Rob Allen's Blog: Quiet around here (Tutorial Translation - Brazillian Portuguese)

DevShed: Validating Octal and Hexadecimal Values with Filters in PHP 5

PHPBuilder.com: Using PHP for the Creation of SVG Images


Community Events





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


library wordpress framework community language podcast api interview bugfix release threedevsandamaybe series developer code project introduction configure list application laravel

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