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 3
August 29, 2011 @ 09:18:28

Michelangelo van Dam is back today with the next part of his "Quality Assurance in PHP Projects" series, the third part of his look at PHPUnit, the popular PHP-based unit testing software.

Time for the third part on unit testing with phpunit in my Quality Assurance on PHP projects series. In part one we started writing unit tests for a simple game of tic-tac-toe. In part two we started converting our unit tests into actual code and moved our general unit test code for grids into a Grid focussed unit test. In this part, we're looking at how we can optimize the tests for our players.

He digs deeper into the TicTacToe application and focuses first on the single-player functionality, checking the symbol for the current player (an "X" or "O") and throwing exceptions in the code when things aren't right. He also shows the tests for checking on "more than one player" and "cannot add more than two players" scenarios. Full code for the Player class and tests are included.

1 comment voice your opinion now!
quality assurance project phpunit unittest tutorial tictactoe tdd


blog comments powered by Disqus

Similar Posts

Chris Hartjes' Blog: Snakes and Elephants Playing Nice Together: PHPUnit and py.test with Hudson

Paul Jones: New Aura System Release, Including Aura.Framework and Aura.Demo

NETTUTS.com: How to Set Up a Killer WordPress Testing Environment Locally

Matthew Weier O'Phinney: ZF2 Modules Quickstart (Screencast)

Zend Developer Zone: Indexing Email Messages with PHP, Zend Lucene and Sphinx


Community Events





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


library bugfix community interview threedevsandamaybe podcast developer tips opinion api symfony introduction language zendserver series list framework laravel deployment release

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