<?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>Fri, 09 Jan 2009 06:52:54 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[CodeUtopia Blog: Database helper for PHPUnit]]></title>
      <guid>http://www.phpdeveloper.org/news/10917</guid>
      <link>http://www.phpdeveloper.org/news/10917</link>
      <description><![CDATA[<p>
On the CodeUtopia blog there's a <a href="http://codeutopia.net/blog/2008/08/27/database-helper-for-phpunit/">recent post</a> with info on creating a custom event listener in PHPUnit that can help keep you database data completely clean.
</p>
<blockquote>
When testing code which uses the database, you would usually want to make sure the database stays pristine for each test - All tables should be empty, as any extra data could interfere with the tests. You could probably write an extended Testcase class which automatically does this before each test in setUp and afterwards in tearDown, but it may have some issues. [...] Luckily, PHPUnit has a way to add event listener that react to certain events.
</blockquote>
<p>
It uses the <a href="http://www.phpunit.de/pocket_guide/3.3/en/phpunit-book.html#extending-phpunit.PHPUnit_Framework_TestListener">TestListener interface</a> to make the event handler that (with the help of Doctrine) starts up, makes the tables with data and wipes them out at the end. 
</p>
<p>
Code for the sample listener is in the post and included is the method for checking to see if you even need to use the database or not.
</p>]]></description>
      <pubDate>Thu, 28 Aug 2008 10:22:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergman's Blog: PHPUnit Support in PHPEclipse]]></title>
      <guid>http://www.phpdeveloper.org/news/5005</guid>
      <link>http://www.phpdeveloper.org/news/5005</link>
      <description><![CDATA[On his blog, <i>Sebastian Bergmann</i> has <a href="http://www.sebastian-bergmann.de/blog/archives/586-PHPUnit-Support-in-PHPEclipse.html">a quick post</a> about the PHPUnit support that he's been shown in an upcoming patch to the <a href="http://www.phpeclipse.de/">PHPEclipse</a> project.
<p>
<quote>
<i>
Steven Balthazor sent me a first version of his <a href="http://www.phpunit.de/">PHPUnit</a> integration for <a href="http://www.phpeclipse.de/">PHPEclipse</a> today.
<p>
The PHPUnit part of this (a TestListener that communicates via a socket with Eclipse) has been <a href="http://news.php.net/php.pear.cvs/39118">committed</a> to CVS. Stephen will make his plugin code available shortly.
</i>
</quote>
<p>
You can grab the update to your PHPUnit install from that CVS location, but keep an eye out for <a href="http://sourceforge.net/tracker/?group_id=57621&atid=484803">the patch</a> to make its way out - they're both required to get it working.]]></description>
      <pubDate>Fri, 17 Mar 2006 07:09:46 -0600</pubDate>
    </item>
  </channel>
</rss>
