News Feed
Sections




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

Till Klampaeckel:
Continuous Integration Automated database setup with Doctrine on Travis-CI
August 14, 2012 @ 10:55:57

Till Klampaeckel has a new post to his site showing how you can use the external continuous integration system Travis-CI to handle automated database testing for your PHP app using Doctrine.

Testing is important - most people understand that by now. A lot of people write tests for their open source code already, but in-house testing is still hard. [...] While I prefer to run my database tests against a SQLite in memory database, there are these edge cases, where I work with multiple database or I write a direct query (and by-pass the ORM-magic). In these cases I need to have that database server available in my test environment! The following blog posts explains how to solve these things with Travis-CI. I will walk you through the setup on Travis-CI's business service. But most of this applies to their open source offering as well.

He's broken it up into a few different steps - the setup and configuration of the ".travis.yml" file, adding in a "composer.json" file with the needed dependencies and the recommendation of a "phpunit.xml" in your project's root. He shows how to use Doctrine's "SchemaTool" utility to generate his schema off of the comments on his entities (instead of checking in SQL). This setup them gives him access to Doctrine's EntityManager object in his tests and he can go from there. If you're thinking about doing something similar, check Travis' list of supported databases before you do anything, just to be sure.

0 comments voice your opinion now!
database testing autmation travisci continuous integration tutorial doctrine


blog comments powered by Disqus

Similar Posts

php|architect: Creating RRD graphs in PHP

PHPMaster.com: Autoloading in PHP and the PSR-0 Standard

Peter Petermann: Building better project skeletons with Composer

SitePoint PHP Blog: Symfony2 Console: Getting Started with Console Helpers

Master Zend Framework: Using the ClassMap Autoloader for Better Performance


Community Events

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


example language podcast opinion framework community series php7 api xdebug interview unittest introduction library install laravel laravel5 extension release voicesoftheelephpant

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