Archive for April, 2011

Mockery 0.7.1 Released - It’s a Test Double Framework

It’s been up on the PEAR channel for a few days now, but Mockery 0.7.1 has been released. The successor to Mockery 0.6 has been brewing for a few months and represents a feature complete version of Mockery’s Mock Objects implementation with a vastly expanded set of features and more than one bug fix ;) . There has never been a better time to give it a whirl. Have a look at the README to see what Mockery is capable of and how to start using it in your unit tests today.

The 0.7.1 version is the result of quite a bit of welcome feedback from users. I’d like to thank everyone who tested it, forked it on Github, debugged it, and suggested feature additions and improvements. Feedback makes the open source world go ’round and ’round.

The race to 1.0.0 is far from over. Mockery 0.8 is the target release for a Test Spy implementation. Test Spies turn Mock Object upside down by allowing users to make assertions about the interactions a Test Spy experienced after the fact. This contrasts with Mock Objects which require that all interaction expectations are set ahead of time. Using Test Spies tends to serve some users better by following the typical unit test paradigm of assertions, and by reducing the overall amount of code needed in many cases. Once added, Mockery will become a true Test Double Framework with support for doing things whatever the hell way you want: Fake Objects, Test Stubs, Mock Objects and Test Spies. Knock yourself out.

On a sidenote, I’d like to mention that PHP can benefit a lot from using leaner meaner Test Double Frameworks. I’m happy to say that Mockery is not the only alternative that has emerged. Mike Lively has recently being working on Phake, a PHP Mocking Framework. That means you all have two choices which are entirely independent of traditional testing frameworks (and a lot better than traditional mock object solutions ;) ).

As usual, your feedback is more than welcome. Mockery is on Github and you can find our issue tracker and a handy fork button at the same URI :P .

Enhanced by Zemanta