News Feed
Sections




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

DZone.com:
A Mockery Review
May 09, 2011 @ 13:05:14

On the Web Builder Zone (a part of DZone.com) there's a recent post from Giorgio Sironi reviewing the Mockery library, a mock object framework created by Padraic Brady.

Mockery is a mock object framework (more properly Test Double framework) from @padraicb, independent from testing frameworks like PHPUnit. It can be used to quickly prepare Mocks, Stubs and other Test Doubles to use inside your unit tests. I've tried Mockery via a PEAR installation and I must say its expressive power is higher than that of PHPUnit mocking system. However, it may be too powerful for effective usage.

He talks about some of the features that are in Mockery that aren't in PHPUnit like alternative expectations, recording of the expected calls and the mocking of non-existent methods. He notes that it can be too overwhelming at times, though, with so many features that may or may not be useful for the large majority of testers. He includes some sample code showing a set of five tests on a simple class implementing an interface.

0 comments voice your opinion now!
mockery testdoubles unittest mock object


blog comments powered by Disqus

Similar Posts

Tony Bibbs' Blog: Geeklog_Generator 1.0.0 Released

Brandon Savage's Blog: Peer Review: Testable Code And Architecture

Michael Nitschinger's Blog: A primer on PHP exceptions

Jani Hartikainen's Blog: Unit testing 4: Mock objects and testing code which uses the database

Sebastian Bergamnn's Blog: SeleniumTestCase Improvements in PHPUnit 3.2


Community Events

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


extension api framework community laravel5 release symfony threedevsandamaybe introduction security laravel version unittest series opinion podcast library interview voicesoftheelephpant language

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