<?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>Thu, 23 May 2013 02:27:03 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Michelangelo van Dam: Learning lessons at ZendUncon]]></title>
      <guid>http://www.phpdeveloper.org/news/18737</guid>
      <link>http://www.phpdeveloper.org/news/18737</link>
      <description><![CDATA[<p>
<i>Michelangelo van Dam</i> has shared something new he learned at the recent ZendCon conference about <a href="http://www.dragonbe.com/2012/11/learning-lessons-at-zenduncon.html">using fixtures with his PHPUnit testing</a>.
</p>
<blockquote>
In <a href="http://www.dragonbe.com/2012/11/zendcon-2012.html">my previous post</a> I already mentioned Sebastian Jerzy Wilczy&#324;ski (<a href="http://twitter.com/dj_sebastian_w">@dj_sebastian_w</a>) and his uncon session "<a href="https://github.com/swilczynski/unittesting">Unit Testing for Databases using fixtures and phpunit</a>". It made me wonder how much difference it would make if you use fixtures instead of testing database interactions using predefined sets of data. Since I work a lot with Zend Framework I was looking at how I could use fixtures and mock objects to follow Sebastian's guidelines. So I gave it a try. This is what I came up with.
</blockquote>
<p>
He illustrates with some example code - a set of database data (the fixtures) and sample tests that use the Zend Framework's mapper and table gateway functionality to work with the tables. His test then mocks out the DbTable class for the "Order" object and forces a return of the database fixture data.
</p>]]></description>
      <pubDate>Tue, 13 Nov 2012 10:04:55 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Carl Vuorinen: Controller testing with database fixtures in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/18699</guid>
      <link>http://www.phpdeveloper.org/news/18699</link>
      <description><![CDATA[<p>
<i>Carl Vuorinen</i> has <a href="http://cvuorinen.net/2012/10/controller-testing-with-database-fixtures-in-zend-framework/">a recent post</a> to his site showing you how to unit test your Zend Framework (v1) controllers with the help of database fixtures to provide the test with valid data.
</p>
<blockquote>
So I started thinking that there must be a way to use fixtures for the database the same way as when testing models with <a href="http://www.phpunit.de/manual/3.6/en/database.html">PHPUnit Database extension</a> (PHPUnit_Extensions_Database_TestCase). But since PHP does not have multiple inheritance, we can't extend both Zend_Test_PHPUnit_ControllerTestCase and PHPUnit_Extensions_Database_TestCase. So I started out to create a controller test case class that has support for fixtures the same way as the database test case. I mean, how hard can it be? 
</blockquote>
<p>
He dug into the code for the extension and finally came up with a working solution - an abstract class with "_setup" and "_setupDatabase" methods that create what you'll need to perform your tests. A sample test is included in the post to show you it in action.
</p>]]></description>
      <pubDate>Mon, 05 Nov 2012 12:44:31 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Joshua Thijssen's Blog: Symfony2: Implementing ACL rules in your Data Fixtures]]></title>
      <guid>http://www.phpdeveloper.org/news/18175</guid>
      <link>http://www.phpdeveloper.org/news/18175</link>
      <description><![CDATA[<p>
<i>Joshua Thijssen</i> has a new post to his blog looking at a method for <a href="http://www.adayinthelifeof.nl/2012/07/04/symfony2-implementing-acl-rules-in-your-data-fixtures/">setting up ACL rules in fixtures</a> for your Symfony2-based applications.
</p>
<blockquote>
Doctrine's DataFixtures are a great way to add test data to your application. It's fairly easy to get this going: Create a fixureLoader that extends DoctrineCommonDataFixturesAbstractFixture, had a load() method and off you go. However, sometimes you want your data also to be protected by Symfony 2&#8242;s ACL layer. Since there isn't a common way to do this, here is one way on how I implemented this.
</blockquote>
<p>
His method uses the ContainerAware interface on the fixture loader instance to be able to get at the container for the fixture. This allows you to use the usual ACL handling methods of the framework to provide restrictions based on things like usernames and roles.
</p>]]></description>
      <pubDate>Wed, 04 Jul 2012 16:33:23 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michael Nitschinger's Blog: RFC: li3_fixtures Rewrite]]></title>
      <guid>http://www.phpdeveloper.org/news/17588</guid>
      <link>http://www.phpdeveloper.org/news/17588</link>
      <description><![CDATA[<p>
<i>Michael Nitchinger</i> has a new post to his blog about <a href="http://nitschinger.at/RFC-li3_fixtures-Rewrite">a rewrite for the Lithium framework</a> - changing up the li3_fixtures plugin to make it a bit more of what the community needs.
</p>
<blockquote>
The <a href="https://github.com/daschl/li3_fixtures">li3_fixtures</a> plugin was my first Lithium plugin ever, and while it works okay, I feel there is a lot I can do to make it better and more flexible. In this post I want to share my ideas for a new fixture plugin and also want to gather feedback from the community to make it even more awesome.
</blockquote>
<p>
He gives three instance where fixtures can come in extremely useful - making effective model unit tests with predictable data, mocking models with shortcuts to the data and mocking out web services. Want to add in your own suggestions for his refactor? <a href="http://nitschinger.at/RFC-li3_fixtures-Rewrite">Comment on the post!</a>
</p>]]></description>
      <pubDate>Mon, 27 Feb 2012 09:23:37 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: Sharing Fixtures and Stubbing/Mocking Static Methods]]></title>
      <guid>http://www.phpdeveloper.org/news/14028</guid>
      <link>http://www.phpdeveloper.org/news/14028</link>
      <description><![CDATA[<p>
<i>Sebastian Bergmann</i> has two recent posts dealing with some of the more difficult topics in unit testing. One looks at <a href="http://sebastian-bergmann.de/archives/884-Sharing-Fixture-Between-Tests.html">sharing fixtures between tests</a> and the other talks about <a href="http://sebastian-bergmann.de/archives/883-Stubbing-and-Mocking-Static-Methods.html">stubbing and mocking static methods</a> in your tests.
</p>
<p>From the <a href="http://sebastian-bergmann.de/archives/884-Sharing-Fixture-Between-Tests.html">first of the two tutorials</a>:
<blockquote>
A good example of a fixture that makes sense to share across several tests is a database connection: you log into the database once and reuse the database connection instead of creating a new connection for each test. This makes your tests run faster.
</blockquote>
<p>
This fixture sharing example uses the setUpBeforeClass and tearDownAfterClass methods to create and destroy the connection.
</p>
<p>
In <a href="http://sebastian-bergmann.de/archives/883-Stubbing-and-Mocking-Static-Methods.html">the second article</a> <i>Sebastian</i> shows how to mock up a sample static function and mock it with the "staticExpects" helper.
</p>]]></description>
      <pubDate>Mon, 15 Feb 2010 12:55:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: PHPUnit 3.4.0 (Release)]]></title>
      <guid>http://www.phpdeveloper.org/news/13241</guid>
      <link>http://www.phpdeveloper.org/news/13241</link>
      <description><![CDATA[<p>
<i>Sebastian Bergmann</i> <a href="http://sebastian-bergmann.de/archives/873-PHPUnit-3.4.0.html">has announced</a> the release of the latest version of the popular PHP unit testing software - <a href="http://phpunit.de">PHPUnit</a>.
</p>
<blockquote>
Among the features introduced in this new version, the most notable are the support for <a href="http://sebastian-bergmann.de/archives/826-Test-Dependencies-in-PHPUnit-3.4.html">test dependencies</a> and <a href="http://sebastian-bergmann.de/archives/848-Fixture-Reuse-in-PHPUnit-3.4.html">fixture reuse</a> as well as the possibility to run tests in separate PHP processes for increased test isolation. Please have a look at the <a href="http://www.phpunit.de/wiki/ChangeLog34">ChangeLog</a> for a complete list of changes.
</blockquote>
<p>
As a teaser, he also mentions the work being done on the <a href="http://github.com/sebastianbergmann/php-code-coverage">code coverage features</a> that will be included in the next release.
</p>]]></description>
      <pubDate>Thu, 17 Sep 2009 11:32:36 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP-Tools Blog: Testing FIT]]></title>
      <guid>http://www.phpdeveloper.org/news/8100</guid>
      <link>http://www.phpdeveloper.org/news/8100</link>
      <description><![CDATA[<p>
On the PHP-Tools blog, <i>Gerd Schauffelberger</i> has <a href="http://blog.php-tools.net/archives/161-Testing-FIT.html">posted about</a> a new PEAR package he's just created to implement the FIT testing protocol.
</p>
<blockquote>
Testing_FIT is the PHP and pearish version of Ward Cunningham's FIT <a href="http://fit.c2.com/">http://fit.c2.com</a>. As such it provides an easy to use framework for acceptance software tests. 
</blockquote>
<p>
The <a href="http://pear.php.net/package/Testing_FIT">package</a> is  a simple download and install and gives you four basic fixtures to use Action-, Column-, Row- and Primitve-Fixture (and a Summary-Fixture for stats purposes).
</p>]]></description>
      <pubDate>Fri, 22 Jun 2007 07:45:00 -0500</pubDate>
    </item>
  </channel>
</rss>
