News Feed
Sections




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

Stefan Priebsch's Blog:
TDD in a self-experiment
June 26, 2008 @ 07:57:32

Stefan Priebsch has posted an overview of some of his experiences with test-driven development in PHP. Specifically, he talks about it in the context of a small CMS he's been working up.

The CMS I am using is a small engine that puts together (potentially multi-lingual) page content, templates, and a site structure, and creates semi-static pages. It does not have a sleek GUI frontend, because by nature I am not afraid of a text editor, and most of the time get quicker results by just writing HTML than fighting with one of these what-you-see-is-what-you-might-get HTML editors.

He talks about the configuration files containing the app's settings (inspired by the YAML Symfony uses) and his work towards the "best matching pattern" algorithm. This is where the TDD came in - he cheated a little with some base classes (tests first!) and then came up with the tests for checking template names and more complex template interactions.

The post includes drops of code here and there as well - examples of the unit tests and of the configuration files.

0 comments voice your opinion now!
testdriven development tdd example cms template configuration file


blog comments powered by Disqus

Similar Posts

ThinkPHP Blog: PHP and Scrum - the dreamteam in agile web development

Andi Gutmans' Blog: Inside Zend Server: Linux Take 2 - Examples

Piotr Walczyszyn's Blog: Configuring Eclipse PDT & Flash Builder 4 Plug-in for PHP/Flex development

SitePoint PHP Blog: Data Fixtures in Symfony2

Padraic Brady's Blog: An Example Zend Framework Blog Application - Part 1: Introductory Planning


Community Events





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


language community laravel podcast update release zendserver unittest package series interview opinion introduction library install deployment framework symfony api tips

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