<?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, 24 May 2012 09:59:02 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Lars Tesmer's Blog: What My Co-Workers and I Learned When Trying to Write Unit Tests for PHPUnit]]></title>
      <guid>http://www.phpdeveloper.org/news/16839</guid>
      <link>http://www.phpdeveloper.org/news/16839</link>
      <description><![CDATA[<p>
<i>Lars Tesmer</i> and his coworkers have been working on improving their development skills lately, specifically <a href="http://lars-tesmer.com/blog/2011/09/08/what-my-co---workers-and-i-learned-when-trying-to-write-unit-tests-for-phpunit/">related to unit testing</a>. In his latest post he shares some of what they've discovered along the way.
</p>
<blockquote>
The plan was to try and write as many tests as we could for the <a href="https://github.com/sebastianbergmann/phpunit/tree/master/PHPUnit/Framework/Constraint">Constraint classes</a> PHPUnit uses to implement its assertions. [...] Well, our plan didn't work out that way, we didn't really succeed in writing a considerable amount of unit tests. However, it still was a valuable experience, as it turned out the unit tests of the Constraints are a good example of how not to unit test.
</blockquote>
<p>
He includes three of the major points they came across in their practice development:
</p>
<ul>
<li>Don't use one single test case class to test several different classes
<li>Name your tests well
<li>Avoid to test more than one behaviour in one single test
</ul>
<p>
For each, there's a summary answering the "why" question behind them including an example test (testConstraintIsType) that shows a bad, multiple assertion practice that should be avoided if possible.
</p>]]></description>
      <pubDate>Fri, 09 Sep 2011 11:56:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Robert Ames' Blog: Upgrading from PHP4 to PHP5]]></title>
      <guid>http://www.phpdeveloper.org/news/5559</guid>
      <link>http://www.phpdeveloper.org/news/5559</link>
      <description><![CDATA[<p>
For those out there wanting to make the move from PHP4 up to PHP5, <i>Robert Ames</i> has posted <a href="http://www.robertames.com/blog.cgi/entries/php4-to-php5-update.html">a few things</a> to watch out for.
</p>
<quote>
<i>
So, I've spent some time upgrading the <a href="http://www.darwingames.com/">darwingames.com</a> codebase to be PHP5 compatible. For those considering the transition (and language designers who are considering an incompatible source version upgrade), I offer the following observations.
</i>
</quote>
<p>
He breaks it down into to categories - the good and the bad. Some of the items on either list include:
<ul>
<li>static methods (good)
<li>E_STRICT (bad)
<li>random passing by reference gone (good)
<li>replacing is_a() with instanceof (bad)
</ul>
</p>
<p>
He also offers some of <a href="http://www.robertames.com/blog.cgi/entries/php4-to-php5-update.html">his personal suggestions</a> for guidelines for future language updates.
</p>]]></description>
      <pubDate>Sun, 11 Jun 2006 13:34:24 -0500</pubDate>
    </item>
  </channel>
</rss>

