<?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 17:45:28 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[DZone.com: PHPUnit vs. Phake cheatsheet]]></title>
      <guid>http://www.phpdeveloper.org/news/19483</guid>
      <link>http://www.phpdeveloper.org/news/19483</link>
      <description><![CDATA[<p>
On DZone.com today <i>Giorgio Sironi</i> has posted a "cheat sheet" to help you correlate the functionality of two PHP unit testing tools - <a href="http://css.dzone.com/articles/phpunit-vs-phake-cheatsheet">PHPUnit vs Phake</a> (for mocking objects).
</p>
<blockquote>
Benjamin Eberlei introduced me to Phake with his recent article: it is a Composer-ready PHP library that integrates easily with PHPUnit and provides an independent Test Doubles framework, capable of producing Stubs, Mocks, and Spies. The syntax and object model reminds me of Mockito, the Java Test Double framework from the authors of Growing Object-Oriented Software. I like tools that do one thing and do it well, and after experimenting with Phake I'm using it on all new code. 
</blockquote>
<p>
He compares the two tools on a few different pieces of functionality including creating stubs, mocks and spies. Sample code is included for both sides. It's not a detailed guide by any means, but it can give you a better picture of how the two compare.
</p>
Link: http://css.dzone.com/articles/phpunit-vs-phake-cheatsheet]]></description>
      <pubDate>Fri, 19 Apr 2013 09:53:45 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[QaFoo.com: Mocking with Phake]]></title>
      <guid>http://www.phpdeveloper.org/news/19308</guid>
      <link>http://www.phpdeveloper.org/news/19308</link>
      <description><![CDATA[<p>
On the QaFoo blog today there's a new tutorial posted showing you how to <a href="http://qafoo.com/blog/037_phake.html">make unit test mocks with Phake</a>, a <a href="http://phake.digitalsandwich.com/">testing tool</a> that works a bit differently that other options (PHPUnit's own mocking and <a href="https://github.com/padraic/mockery">Mockery</a>).
</p>
<blockquote>
The use of Mock and Stub Objects is an important skill to learn when using Test Driven Development (TDD). Mock objects allow you to replace dependencies of an object with lookalikes, much like crash test dummies are used during automobile safety tests so humans aren't harmed. [...] Using Mocks in PHPUnit tests means using the built-in <a href="https://github.com/sebastianbergmann/phpunit-mock-objects">MockObjects library</a> for quite some years. In the last years two contenders emerged that can be used as optional dependencies in PHPUnit. [...] This blog post introduces Phake, because it works quite differently than both PHPUnit Mock Objects and Mockery.
</blockquote>
<p>
They include a code example of how to create mocks with Phake, showing it's different approach to defining the mocked methods. They explain each part of the code, detailing the use of the "when", "thenReturn" and "verify" methods. You can find out more about Phake and see other examples in <a href="http://phake.digitalsandwich.com/docs/html/">the project's documentation</a>.
</p>]]></description>
      <pubDate>Wed, 13 Mar 2013 12:53:26 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike Lively's Blog: Pear Channel set up for Phake]]></title>
      <guid>http://www.phpdeveloper.org/news/15665</guid>
      <link>http://www.phpdeveloper.org/news/15665</link>
      <description><![CDATA[<p>
<i>Mike Lively</i> has <a href="http://digitalsandwich.com/archives/93-pear-channel-set-up-for-phake.html">a new post about a PEAR channel</a> he's set up for his <a href="https://github.com/mlively/Phake">Phake</a> mocking tool on his digitalsandwich.com domain.
</p>
<blockquote>
For those that may not have caught my first post on the subject, <a href="https://github.com/mlively/Phake">Phake</a> is a mock framework that I announced a couple of days ago in <a href="http://digitalsandwich.com/archives/84-introducing-phake-mocking-framework.html">Introducing Phake Mocking Framework</a>. It was recommended in the comments that I get it on a pear channel somewhere, which is something I have wanted to do but hadn't had a reason to do until this week. Well, now there is an official <a href="http://pear.digitalsandwich.com/">Digital Sandwich Pear Channel</a> that is hosting Phake.
</blockquote>
<p>
Discover the channel with the PEAR installer and run the install with the path provided. He notes that the release is alpha because of the lack of documentation but, despite this, the API is stable. Also, you'll need to be using PHP 5.2+ to use the tool.
</p>]]></description>
      <pubDate>Fri, 31 Dec 2010 13:30:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Mike Lively's Blog: Introducing Phake Mocking Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/15649</guid>
      <link>http://www.phpdeveloper.org/news/15649</link>
      <description><![CDATA[<p>
<i>Mike Lively</i> has <a href="http://digitalsandwich.com/archives/84-introducing-phake-mocking-framework.html">a new post to his blog</a> today looking at a mocking framework he's developed to work hand in hand with <a href="http://phpunit.de">PHPUnit</a> to make mocking easier and more robust.
</p>
<blockquote>
I have used PHPUnit heavily now for the last 4 years. As anyone that is heavily involved in writing Unit Tests knows, test doubles (commonly referred to as mock objects) are a necessary part of your toolbox. The mocking options that we used to have for PHP unit testing have traditionally been fairly limited and most all of them in some form or another were ports of <a href="http://www.jmock.org/jmock1-getting-started.html">JMock</a>. The way PHP operates as well as some decisions made to more closely emulate how JMock does things lead to functionality in the existing mock library for PHPUnit that for some are a hassle.
</blockquote>
<p>
To help eliminate this hassle, he create the <a href="https://github.com/mlively/Phake">Phake</a> mocking framework - a tool that comes at mocking a different way than the normal PHPUnit procedures. He includes some sample code for a class to test, a simple stub for getting a value and how to use it in a basic test. By calling a "Phake::mock()" on the class to make an object, you can call the method and run a "verify()" to ensure that the results are correct. He talks about some other options that the mocking allows too like calling a "no interaction" method on a mock and argument capturing.
</p>]]></description>
      <pubDate>Wed, 29 Dec 2010 08:40:27 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Pavel Shevaev's Blog: taskman: yet another Ant alternative]]></title>
      <guid>http://www.phpdeveloper.org/news/15279</guid>
      <link>http://www.phpdeveloper.org/news/15279</link>
      <description><![CDATA[<p>
<i>Pavel Shevaev</i> has <A href="http://efiquest.org/2010-10-13/35/">put together</a> what he calls "yet another Ant alternative" - a tool written in PHP to create project related tasks in a style that matches the <a href="http://ant.apache.org/">Ant</a> and <a href="http://rake.rubyforge.org/">rake</a> methods.
</p>
<blockquote>
There is a <a href="http://code.google.com/p/lib-taskman/">lib-taskman project</a> on the google code hosting where you can find the <a href="http://code.google.com/p/lib-taskman/wiki/TaskmanUsage">full documentation</a>, <a href="http://code.google.com/p/lib-taskman/source/checkout">sources</a> and <a href="http://code.google.com/p/lib-taskman/downloads/list">latest releases</a>. It's probably not that elegant as rake but if you want to stick to PHP and have Ant-alike functionality without any XML programming then taskman may turn out to be handy. taskman is very simple to use, it requires only one include, all its code resides in one PHP file, and it has no external dependencies.
</blockquote>
<p>
He includes a basic use example that sets up the build with "task_hello", "task_comma", "task_world" and "task_say" methods that each do some basic output to show the flow of the process. He also gives examples of possible uses for the tasks like database bootstrapping, auto-code generation, project deployment, etc. He also mentions two other PHP-based projects that do similar things - <a href="http://github.com/indeyets/pake">pake</a> and <a href="http://github.com/jaz303/phake">Phake</a>.
</p>]]></description>
      <pubDate>Thu, 14 Oct 2010 09:56:39 -0500</pubDate>
    </item>
  </channel>
</rss>
