<?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 05:41:28 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Giorgio Sironi's Blog: Refactoring PHPUnit's getMock()]]></title>
      <guid>http://www.phpdeveloper.org/news/14988</guid>
      <link>http://www.phpdeveloper.org/news/14988</link>
      <description><![CDATA[<p>
<i>Giorgio Sironi</i> has <a href="http://giorgiosironi.blogspot.com/2010/08/refactoring-phpunit-getmock.html">a new post</a> to his blog about a "refactoring" he's done of <a href="http://phpunit.de">PHPUnit</a>'s mock objects to make their creation with getMock easier.
</p>
<blockquote>
Not an actual refactoring, but at least the introduction of a layer of indirection, a Parameter object, called PHPUnit_Framework_MockSpecification. I have already written the patch in a branch of my github repository. They are actually two independent patches, since PHPUnit core and the mocking component are in two separate repositories. 
</blockquote>
<p>
If you create a basic object, the creation is simple, but when you start wanting to use one of the other optional parameters down the line, things can get messy. His solution adds methods like disableOriginalConstructor and disableAutoload to make this simpler. You can find the patches <a href="http://github.com/giorgiosironi/phpunit/commit/c7d62874ff9c1ed6f520e98cab2568c9bb933ec6">on his github account</a>.
</p>
<p>
UPDATE: This feature <a href="http://giorgiosironi.blogspot.com/2010/08/phpunit-mockbuilder-in-master-branch.html">has been included</a> in the latest PHPUnit master branch.
</p>]]></description>
      <pubDate>Thu, 19 Aug 2010 10:49:16 -0500</pubDate>
    </item>
  </channel>
</rss>
