News Feed
Jobs Feed
Sections




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

Sebastian Bergmann's Blog:
Getting Started with Hamcrest
January 09, 2008 @ 10:23:00

Following up on the start of his port of the Hamcrest (a library of "matchers") functionality over to PHP, Sebastian Bergmann has posted the getting started guide to show you how to use it with the popular PHPUnit unit testing software.

There are a number of situations where matchers are invaluble, such as UI validation, or data filtering, but it is in the area of writing flexible tests that matchers are most commonly used.

His example that checks to see if one object is equal to another object. The Hamcrest matcher allows for a "assertThat" method making it easier to create and use pre-existing unit testing assertions.

He also includes a list of some of the most common matchers broken up into groups of core, logical, object, number and text.

0 comments voice your opinion now!
hamcrest matcher library gettingstarted tutorial assert hamcrest matcher library gettingstarted tutorial assert


blog comments powered by Disqus

Similar Posts

Devshed: The Basics of Using the Prototype Pattern with PHP 5

SitePoint.com: OAuth for PHP Twitter Apps, Part 2

Kevin Boyd: Retrofitted Login Throttling

BillS' IIS Blog: How to install PHP on IIS7 (RC1)

Pierre-Alain Joye's Blog: ext/filter, API frozen (!) and fixes, 0.11.0 is out


Community Events











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


composer release support application opinion introduction install unittest component framework symfony2 language hhvm package code podcast overview facebook hack security

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