News Feed
Sections




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

Sameer Borate's Blog:
Test dependencies in PHPUnit 3.4
December 21, 2009 @ 08:50:17

On his blog today Sameer Borate has posted a method for creating test dependencies in your PHPUnit tests on your application.

PHPUnit 3.4 now supports dependencies between different test methods. It allows you to execute a particular test ONLY IF the test that it depends on executes successfully (using a linked-list class.

He starts off with a simple tests and breaks it up into two different pieces - one to test the creation of the list and another to test the linking of the list. By using the "@depends" notation in the comments of the linking test, you can tell PHPUnit to link the two and only pass if both do. He also touches on Producers and Consumers in testing.

0 comments voice your opinion now!
unittest depend phpunit


blog comments powered by Disqus

Similar Posts

Stefan Priebsch's Blog: PHPUnit test and Code Coverage Statistics with phing

Lars Tesmer's Blog: How to Unit Test a Class Making Calls to an URL (or the Filesystem) With PHPUnit

Stubbles Blog: vfsStream 0.1.0 Released

Sebastian Bergmann's Blog: Using PHPUnit from a Git Checkout

SitePoint PHP Blog: pTest: PHP Unit Tester in 9 Lines Of Code


Community Events





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


deployment update framework package symfony interview release language library introduction laravel api opinion tips community podcast series zendserver install list

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