News Feed
Sections




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

Mike Lively's Blog:
Adding Database Tests to Existing PHPUnit Test Cases
September 05, 2007 @ 10:50:30

Mike Lively has posted about functionality he's created to add database testing procedures to preexisting PHPUnit tests supplementing his other post n adding database support to PHPUnit.

When I was first creating the Database Extension for PHPUnit I realized that there was a very high likelihood that several people would have tests that were already written that they would like to add additional database tests too. To accomplish this I actually wrote the PHPUnit_Extensions_Database_DefaultTester class. In fact, if you were to look at the source of the database test case you will see that all of it's operations are actually forwarded to this class which does all of the work.

He includes his same example from before - the banking system - and shows how the tests can be appended on, adding a getDatabaseTester method that returns an object the rest of the tests can use.

0 comments voice your opinion now!
database test phpunit unittest existing case database test phpunit unittest existing case


blog comments powered by Disqus

Similar Posts

Rafael Dohms' Blog: Debugging PHPUnit Tests in NetBeans with XDebug

WebReference.com: Accessing Your MySQL Database from the Web with PHP

Geeks Not Nerds Blog: Rolling your own Blog Backend from Scratch Part 1

Chris Hartjes: The Power of the BrowserProxyMob

Wojciech Sznapka's Blog: Why Mockery is better than PHPUnit Mock Builder (with Symfony2)


Community Events





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


framework list language testing developer install opinion community symfony2 threedevsandamaybe series configure release introduction interview podcast code laravel refactor unittest

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