News Feed
Sections




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

Padraic Brady's Blog:
The Mockery An Independent Mock Object and Stub Framework for PHP5
March 06, 2009 @ 10:28:58

Noting the lack of a good, independent library for creating Mock Objects for unit testing PHP scripts, Padraic Brady (with assistance from Travis Swicegood) has come up with a standalone Mock Object and Stub framework - Mockery.

It's not tailored specifically to any one testing framework, rather it's an entirely separate framework with a discrete API. The idea is that you can use this framework within PHPUnit, or SimpleTest, or anything else really, without being forced to rely on the built-in support (if any) that test framework provides. Mockery was designed specifically to implement a form of Domain Specific Language (DSL). It makes extensive use of a fluent interface mixed with methods to approximate plain English.

He includes an overview of what Mock Objects and Stubs are and how to set them up with the Mockery tool. He finishes things off with a look at the Mockery and Mock Object Expectation APIs. You can grab this first release either as a PEAR package or from its github page.

0 comments voice your opinion now!
mockery php5 stub testing unittest object simpletest phpunit standalone


blog comments powered by Disqus

Similar Posts

DevShed: Searching and Replacing Nodes with SimpleXML in PHP 5 (Part 3)

Ivo Jansch's Blog: PHP4 to 5 migration webinar

Nefarious Designs: Object-Oriented PHP Part 1: Definition

PHP in Action: Real programming with PHP 5.3 (part 1): array processing

Marcelo Gornstein's Blog: PHP Continuous integration, with Jenkins and Phing


Community Events

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


voicesoftheelephpant laravel5 opinion language framework interview community php7 example security list version laravel introduction series extension release podcast library api

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