News Feed
Sections




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

Matthew Turland's Blog:
Database Testing with PHPUnit and MySQL
January 05, 2010 @ 13:24:49

In a new post to his blog Matthew Turland looks at a contribution he recently made to the PHPunit project to help it support database testing without the need for dumping the contents of your database out to a CSV.

If you're using MySQL as your database, CSV has been the only format supported by both the mysqldump utility and the PHPUnit Database extension up to this point. My contribution adds support for its XML format to the extension. While this support was developed to work in the PHPUnit 3.4.x branch, it won't be available in a stable release until 3.5.0. In the meantime, this is how you can use it now.

There's four steps you'll need to do to get it installed - grab the latest from github, create the seed data XML file, make a test case extending PHPUnit_Extensions_Database_TestCase and run your tests against the database information.

0 comments voice your opinion now!
phpunit database testing mysql unittest


blog comments powered by Disqus

Similar Posts

Job Posting: Assembleron Ltd Seeks PHP 5/MySQL/Ajax Developers (Reading, UK)

Paul Jones\' Blog: Solar 0.18.0 released, and more about testing

Sebastian Begmann's Blog: Partitioning with Dates in MySQL 5.1

Michelangelo van Dam's Blog: Zend Framework Bughuntday review

Konstantin Kudryashov: Conceptual difference between Mockery and Prophecy


Community Events





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


wordpress code interview application introduction series list developer unittest laravel library language install threedevsandamaybe symfony release configure api community podcast

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