News Feed
Sections




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

Michelangelo van Dam's Blog:
Quality Assurance on PHP projects - PHPUnit part 2
August 23, 2011 @ 08:38:19

Michelangelo van Dam has posted the second part of his look at PHPUnit in his "Quality Assurance in PHP Projects" blog post series. This is a continuation from part one.

I hope everyone enjoyed my first article on unit testing with phpunit where I started writing a few tests that would guide us building our little game of tictactoe. Today I'm going start with turning these tests into working code and adjusting our tests to have a clear separation of responsibility. Since we already know what the code should produce, we only have to work out the details.

He picks up where he left off on his "tic-tac-toe" example by defining some of the classes that will be needed to fulfill the tests and a sample test to check the generated grid's contents. He includes the Grid class that will do the job (full code included) and a full test case class that runs his example with checks on testGameGridIsSetAtStart, testGridCanPositionASymbol, testGridHasThreeSymbolsInARow and testGridHasThreeSymbolsInAColumn, some with their own data providers.

0 comments voice your opinion now!
quality assurance project phpunit unittest tutorial tictactoe tdd


blog comments powered by Disqus

Similar Posts

PHPClasses.org: Using DaDaBIK to create a PHP CRUD Database Front-End without coding

AnyExample.com: Bar chart HTML generator

Eran Galperin's Blog: Profiling queries with Zend_Db and optimizing them by hand

Zend Developer Zone: Paging and Sorting Data with Zend Framework, Doctrine and PEAR (part 2)

QaFoo.com: Mocking with Phake


Community Events

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


laravel5 interview library development series laravel voicesoftheelephpant opinion language api community unittest extension podcast wordpress release threedevsandamaybe feature framework introduction

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