<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 19 Jun 2013 07:15:34 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPBuilder.com: PHPUnit Fundamentals: Setting Up and Tearing Down a Doctrine 2 Database]]></title>
      <guid>http://www.phpdeveloper.org/news/16736</guid>
      <link>http://www.phpdeveloper.org/news/16736</link>
      <description><![CDATA[<p>
New on PHPBuilder.com today is a tutorial showing you how to use set up and tear down methods in <a href="http://phpunit.de">PHPUnit</a> unit tests to <a href="http://www.phpbuilder.com/columns/phpunit-doctrine/Jason_Gilmore08172011.php3">work with a Doctrine 2 database</a>, making it simpler to run self-contained testing.
</p>
<blockquote>
The recently released Doctrine 2 presents significant advantages over its 1.X predecessor, advantages which are even more pronounced when compared to the Zend Framework's default database solution, namely the <a href="http://framework.zend.com/manual/en/zend.db.html">Zend_Db component</a>. [...] When running unit tests which vet various aspects of your database you'll want to setup (create) and teardown (destroy) the test database, ensuring that a pristine and repeatable version of the database is available to each test. 
</blockquote>
<p>
He includes an example of using the SchemaTool class (of Doctrine) to drop and recreate the schema from scratch with the end result of a clean working copy, ready to test from. He also includes an example of how to initialize the database with some default information using the PHPUnit database connection and a default set of fixtures (defined in YAML).
</p>]]></description>
      <pubDate>Thu, 18 Aug 2011 09:03:40 -0500</pubDate>
    </item>
  </channel>
</rss>
