<?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>Sun, 19 May 2013 11:42:51 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Timothy Boronczyk: PHP Assertions]]></title>
      <guid>http://www.phpdeveloper.org/news/18717</guid>
      <link>http://www.phpdeveloper.org/news/18717</link>
      <description><![CDATA[<p>
<i>Timothy Boronczyk</i> has written up a new post that looks at <a href="http://zaemis.blogspot.com/2012/10/php-assertions.html">using assertions in PHP</a> - the actual use of the <a href="http://php.net/assert">assert</a> function to evaluate values in your code.
</p>
<blockquote>
I stumbled upon assertions in PHP today, though why I didn't know they existed after working with the language for so long and what I was looking for originally when I came across them are both mysteries. And with the increasing focus on software quality in the PHP community, I wondered why I hadn't seen them used by others. I decided to ask around, look into PHP's implementation of assertions, and do some tinkering.
</blockquote>
<p>
He talks some about their usage, some of the common issues surrounding them and compares using them directly on return values vs evaled strings. He also includes an implementation of them in a bit of sample code - a class that uses them (and an assertion callback) to handle the throwing of exceptions.
</p>
<blockquote>
Assertions are meant to identify program logic/design bugs, not as a run-time error handling mechanism. Isn't this why we do unit testing? Playing devil's advocate, what's wrong with pushing unit tests directly into your code if we have doc comments that are extracted for documentation?
</blockquote>]]></description>
      <pubDate>Thu, 08 Nov 2012 11:43:49 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[SitePoint.com: Be More Asssertive: Getting to Know PHPUnit's Assertions]]></title>
      <guid>http://www.phpdeveloper.org/news/15778</guid>
      <link>http://www.phpdeveloper.org/news/15778</link>
      <description><![CDATA[<p>
On SitePoint.com today there's <a href="http://blogs.sitepoint.com/2011/01/20/be-more-asssertive-getting-to-know-phpunits-assertions/">a new article</a>, the second in the series, introducing unit testing in PHP with <a href="http://phpunit.de">PHPUnit</a>. The first article can be <a href="http://phpdeveloper.org/news/15598">found here</a>. (Disclaimer: I am the author of this series of articles).
</p>
<blockquote>
In my <a href="http://blogs.sitepoint.com/2010/12/16/tutorial-introduction-to-unit-testing-in-php-with-phpunit/">previous article</a>, I took you through some of the basics of unit testing with PHPUnit. I introduced you to what it means to test your code and the real benefits it can for you and your code. This time I want to dive in a little deeper and get to know PHPUnit in a bit more detail.
</blockquote>
<p>
The tutorial goes into more detail on some of the commonly used assertion methods PHPUnit has to offer including: assertTrue, assertLessThanOrEqual, assertStringStartsWith, assertSame and assertClassHasAttribute. There's also a brief discussion about marking tests incomplete or skipped and how, except in some circumstances, it should be avoided at all costs.
</p>]]></description>
      <pubDate>Thu, 20 Jan 2011 13:32:28 -0600</pubDate>
    </item>
  </channel>
</rss>
