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

Ryan Mauger's Blog:
Controller Testing with the FlashMessenger in Zend Framework
Mar 16, 2012 @ 16:55:53

Ryan Mauger has a new post to his blog today looking at doing some controller testing in a Zend Framework application and some issues he was with the FlashMessenger component.

During a recent project, I encountered problems with the flash messenger not playing ball with PHPUnit. The problem, the FlashMessenger using a session namespace, and trying to start the session. Additionally to this problem, how do you test that the flash message is set as you’d expect (or not as the case may be). The answer to both of these problems, lies in the same solution. a Mock Object.

He includes the code to mock out the FlashMessenger component and expose the "addMessage" method. In his first test, the assertion is that this method is never called (failure if it is) and in the second, it should only be called once.

tagged: zendframework unittest phpunit flashmessenger mockobject

Link:

Sebastian Bergmann's Blog:
PHPUnit 3.5 Upgrading Woes
Oct 22, 2010 @ 12:42:23

If you've been having issues upgrading to the latest version of PHPUnit (v3.5), Sebastian Bergmann might have the answer to your problems that's related to the PEAR installer and this bug.

The new dependencies of the PHPUnit package, such as PHPUnit_MockObject for instance, are installed first. The PHPUnit package itself is installed last. And herein lies the problem: PHPUnit_MockObject installs the new version of MockObject/Generator.php before the PHPUnit package is upgraded. This upgrade deletes the MockObject/Generator.php file as it previously belonged to the PHPUnit package.

He includes two complete file listings showing the difference in the structure before and after the upgrade. The PEAR installer is at fault due to a misunderstanding it has about where the MockObject/Generator.php file belongs. The only way to fix this, currently, is to force install the new subpackages instead of just an update - DbUnit, PHPUnit_MockObject and PHPUnit_Selenium. Instructions and a resulting files tree are included so you can insure your install is correct.

tagged: phpunit upgrade pear installer mockobject

Link:

Sebastian Bergmann's Blog:
PHPUnit Status Update
Jun 25, 2007 @ 13:22:00

Sebastian Bergmann has posted an update of the status of the PHPUnit project to his blog today including feature additions to PHPUnit 3.1 and ones being added to other branches.

The last weeks have been busy, but now I want to take the time to finally give you an update on the status of PHPUnit. The development of PHPUnit 3.1 is progressing nicely, about the only thing missing is finishing the documentation for all the new features

Among these new features are things like:

tagged: phpunit status project mockobject selenium templatemethod database mutation phpunit status project mockobject selenium templatemethod database mutation

Link:

Sebastian Bergmann's Blog:
PHPUnit Status Update
Jun 25, 2007 @ 13:22:00

Sebastian Bergmann has posted an update of the status of the PHPUnit project to his blog today including feature additions to PHPUnit 3.1 and ones being added to other branches.

The last weeks have been busy, but now I want to take the time to finally give you an update on the status of PHPUnit. The development of PHPUnit 3.1 is progressing nicely, about the only thing missing is finishing the documentation for all the new features

Among these new features are things like:

tagged: phpunit status project mockobject selenium templatemethod database mutation phpunit status project mockobject selenium templatemethod database mutation

Link:


Trending Topics: