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

Ask About PHP: PHP and jQuery: Submit a form without refreshing the page

MakeBeta Blog: Facebook PHP Tutorial

Chris Hartjes' Blog: The Devilís In The Details (or, Handling Sequences in Postgres in CakePHP)

Josh Adell's Blog: Neo4j for PHP

Roy Ganor's Blog: 1 Community, Dozen programmers, 1186 bugs & one quest for transcendent PHP editor


Community Events





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


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

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