Sebastian Bergmann has more information over on his blog today about the creation of Mock Objects in PHPUnit (a popular unit testing framework).
Suppose you have the following class Foo:
While I am preparing the PHPUNIT_2_3 CVS branch for a release of PHPUnit 2.3.0 alongside PHP 5.1.0, I recently started working on support for Mock Objects in PHPUnit.
You can now write a test case that checks whether or not the bar() gets called on an object of the Foo class.
This feature can come in quite handy when testing your site, especially if you want to ensure that a specific "stubbed-out" object/method always runs.




