<?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>Mon, 20 May 2013 01:25:09 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Raphael Stolt's Blog: Creating custom PHPUnit assertions]]></title>
      <guid>http://www.phpdeveloper.org/news/10705</guid>
      <link>http://www.phpdeveloper.org/news/10705</link>
      <description><![CDATA[<p>
<i>Raphael Stolt</i> has <a href="http://raphaelstolt.blogspot.com/2008/07/creating-custom-phpunit-assertions.html">written up a post</a> for his blog talking about custom PHPUnit assertions and a simple method to create them.
</p>
<blockquote>
In this blog post I'd like to set the focus on some of the aspects of the <a href="http://xunitpatterns.com/Custom%20Assertion.html">Custom Assertion</a> pattern, by showing how to create custom <a href="http://www.phpunit.de/">PHPUnit</a> assertions, which attacks the above mentioned smell [of bad test code] and its retroactive effects with a huge antiperspirant flagon, while also providing the chance to build a customer friendly and domain related test vocabulary.
</blockquote>
<p>
His first assertion is simple, checking the contents of a bag object to be sure that there are no duplicate items and that its content count is reduced by one if something is removed. Then, he moves on to making the custom assertion for his "IdShouldFollowAgreedConvention" test. He explains how to use the assertion class and how it all fits together in the final, functional test case.
</p>]]></description>
      <pubDate>Tue, 29 Jul 2008 10:25:15 -0500</pubDate>
    </item>
  </channel>
</rss>
