News Feed
Sections




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

Jachim Coudenys:
Using multiple databases in phpunit/dbunit with Composer
November 21, 2012 @ 11:56:04

Jachim Coudenys has a new post to his site today showing you how to use multiple databases with phpunit/dbunit with functionality installed via Composer.

phpunit/dbunit is excellent, but you are stuck with one database. The guys at Etsy created very good extensions to fix this problem (MultipleDatabase), but it took me a while to figure out how to use it. Because PHPUnit is now available via Composer, you can fetch all dependencies with a single command.

He includes an example of a "composer.json" configuration file that pulls down tools including PHPUnit, dbunit, the Etsy extensions and Mockery for mock object testing. He suggests making a "parent class" to extend the DatabaseTest class to manage the database connections and includes an example of the code to get the connection and issue the method to check via the database assertions.

0 comments voice your opinion now!
phpunit unittest dbunit database multiple tutorial


blog comments powered by Disqus

Similar Posts

NetTuts.com: Creating a Flat-File Blog Engine Using Slim

PHPMaster.com: Using YAML in Your PHP Projects

PHPMaster.com: Using SPL Iterators, Part 2

Tony Lukasavage's Blog: PHP Debugging on IntelliJ IDEA 10 with Xdebug

Engrowe.com: How-to - Convert a RSS feed to JSON in PHP


Community Events





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


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

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