<?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>Tue, 22 May 2012 12:36:26 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Rob Allen's Blog: Unit testing controller actions with Zend_Test_PHPUnit_ControllerTestCase]]></title>
      <guid>http://www.phpdeveloper.org/news/15081</guid>
      <link>http://www.phpdeveloper.org/news/15081</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a new post for all of the unit test fans out there wanting to test their Zend Framework controllers. He show how to make it worlds easier with the <a href="http://akrabat.com/zend-framework/unit-testing-controller-actions-with-zend_test_phpunit_controllertestcase/">help of Zend_Test_PHPUnit_ControllerTestCase</a>.
</p>
<blockquote>
Testing controllers has traditionally been a hassle due to the requirements of setting up the bootstrap, the front controller and initiating the dispatch cycle. In June, <a href="http://weierophinney.net/matthew/archives/182-Testing-Zend-Framework-MVC-Applications.html">Matthew</a> addressed this with the release of <a href="http://framework.zend.com/manual/en/zend.test.phpunit.html">Zend_Test_PHPUnit_ControllerTestCase</a> way back in 2008. Later, Matthew helpfully wrote an article on <A href="http://weierophinney.net/matthew/archives/190-Setting-up-your-Zend_Test-test-suites.html">how to use it</a> and I have used that as a starting point for the information here.
</blockquote>
<p>
He illustrates with the <a href="http://github.com/akrabat/TodoIt">TodoIt</a> application and shows how to correctly set up <a href="http://phpunit.de">PHPUnit</a> including a TestHelper file that acts as a bootstrap when running the tests. <i>Rob</i> gives the code for a sample controller and a basic tests to run against it - checking for an "h1" element containing "Login".
</p>]]></description>
      <pubDate>Mon, 06 Sep 2010 10:28:17 -0500</pubDate>
    </item>
  </channel>
</rss>

