<?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>Fri, 24 May 2013 02:29:58 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Engine Yard: A Conversation About Testing in PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/19622</guid>
      <link>http://www.phpdeveloper.org/news/19622</link>
      <description><![CDATA[<p>
On the Engine Yard blog today they've <a href="https://blog.engineyard.com/2013/a-conversation-about-testing-in-php">posted a conversation about testing</a> between <I>Ed Finkler</i> and <i>Chris Hartjes</i> (also the hosts of the <a href="http://devhell.info/">DevHell podcast</a>).
</p>
<blockquote>
Our friends <a href="https://twitter.com/funkatron">Ed Finkler</a> and <a href="https://twitter.com/grmpyprogrammer">Chris Hartjes</a> recently had a chat about testing in PHP.  Read on to get the low down on different testing tools and their relative merits-check it out as Ed and Chris weep for the future, come to some interesting conclusions and get their hands dirty so you don't have to.
</blockquote>
<p>
They talk some about the current tools for unit testing in PHP applications and show what a sample test looks like. <i>Ed</i> talks about how the current testing tools can make it intimidating for people to get started testing and mentions the built-in testing library in Python that is a bit easier. There's also some mention of acceptance/functional testing and the Behat + Mink combo.
</p>
Link: https://blog.engineyard.com/2013/a-conversation-about-testing-in-php]]></description>
      <pubDate>Thu, 23 May 2013 09:42:29 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Codeception.com: Specification or Testing: The Comparison of Behat and Codeception]]></title>
      <guid>http://www.phpdeveloper.org/news/19560</guid>
      <link>http://www.phpdeveloper.org/news/19560</link>
      <description><![CDATA[<p>
On the Codeception site today there's a new post that <a href="http://codeception.com/05-06-2013/specification-testing-coparison.html">compares their tool, Behat and PHPUnit</a> for testing your applications.
</p>
<blockquote>
This is guest post by <a href="https://github.com/Ragazzo">Ragazzo</a>. He uses Behat as well as Codeception for making his project better. He was often asked to do a comparison between Codeception, Behat, and PhpUnit. In this post he explains the commons and different parts of this products.
</blockquote>
<p>
The author talks some about the difference between functional/acceptance tests and how they fit in with behavior driven development. He includes some examples of Behat test formats (Gherkin) and how it can be used for both the functional and acceptance side of things. He also talks some about why he prefers Codeception over Behat(+Mink) for his testing. A sample Codeception test is included, showing a login form check.
</p>
Link: http://codeception.com/05-06-2013/specification-testing-coparison.html]]></description>
      <pubDate>Wed, 08 May 2013 09:28:34 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Inviqa techPortal: Functionally Testing You Application Using Mink]]></title>
      <guid>http://www.phpdeveloper.org/news/19538</guid>
      <link>http://www.phpdeveloper.org/news/19538</link>
      <description><![CDATA[<p>
On the Inviqa TechPortal today there'a a new post from <i>Konstantin Kudryashov</i> showing you how to <a href="http://techportal.inviqa.com/2013/05/02/functionally-testing-your-application-using-mink/">use Mink for functional testing</a> (an extension of <a href="http://behat.org">Behat</a>) of you web application.
</p>
<blockquote>
Automated testing is big news these days. There's hardly a PHP conference happening without a talk on testing automation or derivative methodologies. TDD (Test-Driven Development) and BDD (Behaviour Driven Development) are all around us. So why should you care about all this? [...] The more complex an application becomes, the harder it is to be sure that each new feature or bug fix won't break the system, and that decreases your overall confidence in your work as developer. That's exactly the reason why you need automated testing - to be confident that you're not breaking important parts of an application.
</blockquote>
<p>
For his examples he uses a simple <a href="http://silex.sensiolabs.org/">Silex</a>-based application (found <a href="https://github.com/everzet/silex-mink">here on github</a>) that just shows a main page and an "add article" page that returns a preview when submitted. He shows how to get Behat/Mink installed and how to bootstrap PHPUnit to allow you to execute your tests. Also included is a sample test that clicks the "Add Article" link, runs a few checks and fills in some data. The form is submitted and the "preview" page is checked for valid results.
</p>
Link: http://techportal.inviqa.com/2013/05/02/functionally-testing-your-application-using-mink]]></description>
      <pubDate>Thu, 02 May 2013 13:50:44 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Alvaro Videla: Using RabbitMQ in Unit Tests]]></title>
      <guid>http://www.phpdeveloper.org/news/19529</guid>
      <link>http://www.phpdeveloper.org/news/19529</link>
      <description><![CDATA[<p>
<i>Alvaro Videla</i> has a new post today showing how he <a href="http://videlalvaro.github.io/2013/04/using-rabbitmq-in-unit-tests.html">used RabbitMQ in his unit testing runs</a> with a small, quickly installed version of the server that can be removed once the tests are complete.
</p>
<blockquote>
In this blog post I want to show you a very simple technique for using RabbitMQ in our Unit or Functional Tests. Let's say you wrote a bunch of tests for your RabbitMQ consumers and then it's time to run them. To do that you probably need to setup a RabbitMQ server just for tests with their own users and passwords, or you need to set up a whole new virtual host for your tests. [...] With a future release of RabbitMQ that we can already test on the nightlies website, we can run RabbitMQ without the need to install Erlang. We created a package that ships a stripped down version of Erlang together with the broker bits, so running RabbitMQ now is as easy as downloading a tarball, uncompressing it and starting the server. 
</blockquote>
<p>
With a combination of this more self-contained package and some listener handling through PHPUnit, they uncompress the tarball with a PHP script and start the server with the defined configuration. Then, once the tests are done, it cleans itself up and removes the entire server directory to make for a clean run the next time.
</p>
Link: http://videlalvaro.github.io/2013/04/using-rabbitmq-in-unit-tests.html]]></description>
      <pubDate>Wed, 01 May 2013 09:10:11 -0500</pubDate>
    </item>
    <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[Juan Treminio: Unit Testing Tutorial Part V: Mock Methods and Overriding Constructors]]></title>
      <guid>http://www.phpdeveloper.org/news/19416</guid>
      <link>http://www.phpdeveloper.org/news/19416</link>
      <description><![CDATA[<p>
<i>Juan Treminio</i> has posted the <a href="http://jtreminio.com/2013/03/unit-testing-tutorial-part-5-mock-methods-and-overriding-constructors/">latest part of his unit testing series</a> to his site today - the fifth part that looks at using mock methods on mock objects and overriding constructors.
</p>
<blockquote>
Previously in my PHPUnit tutorial series, you learned about the very powerful concept of mock objects and stub methods. This concept is central to successful unit testing, and once it fully 'clicks' in your head you will start to realize how useful and simple testing can be. There is also another thing I want to make clear: creating tests is basically a puzzle - you simply have to go step by step, making sure all the pieces fit together correctly so you can get your green. I hope to make clear what I mean by the end of this tutorial.
</blockquote>
<p>
He assumes you already know about mock objects and introduces the concept of "stub methods" and "mock methods", noting the difference between them. He then gets into what he calls the "four pathways of getMockBuilder" and talks about the rationale behind mocking methods in the first place. He then gets into constructors and how you can work around the "bad" ones with help from mock object functionality. 
</p>
<p>
If you're interested in reading the rest of the series, you can find links to them <a href="http://jtreminio.com/tag/phpunit/">here</a>.
</p>
Link: http://jtreminio.com/2013/03/unit-testing-tutorial-part-5-mock-methods-and-overriding-constructors/]]></description>
      <pubDate>Fri, 05 Apr 2013 09:38:49 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[/Dev/Hell Podcast: Episode 30: It's Episode 30, You Guys]]></title>
      <guid>http://www.phpdeveloper.org/news/19391</guid>
      <link>http://www.phpdeveloper.org/news/19391</link>
      <description><![CDATA[<p>
The /Dev/Hell podcast has posted their latest episode - <a href="http://devhell.info/post/2013-03-29/its-episode-30-you-guys/">#30 - "It's Episode 30, You Guys"</a>:
</p>
<blockquote>
In our action-packed 30th episode Ed and Chris discussed their experiences with JavaScript testing tools, specifically how certain tools push you towards specific refactoring patterns. Chris talked about the successful launch of his <a href="http://grumpy-phpunit.com/">latest book on using PHPUnit</a> and got into some honest talk about revenue and how the <a href="http://unicornfree.com/30x500">product development course</a> helped him make this book do 4 times the launch day revenue of his previous one. Ed discussed his plans to <a href="http://www.indiegogo.com/projects/open-sourcing-mental-illness">talk about mental illness</a> on the conference circuit this year. Please help out by donating to the campaign!
</blockquote>
<p>
You can listen to this latest episode either using the <a href="http://devhell.info/post/2013-03-29/its-episode-30-you-guys/>in-page player</a> or by <a href="http://devhell.s3.amazonaws.com/ep30-64mono.mp3">downloading the mp3</a>. You can also <a href="http://feeds.feedburner.com/devhell-podcast">subscribe to the feed</a> to get this and future episodes as they're released.
</p>]]></description>
      <pubDate>Mon, 01 Apr 2013 10:19:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Michelangelo van Dam: Look mama, no databases]]></title>
      <guid>http://www.phpdeveloper.org/news/19325</guid>
      <link>http://www.phpdeveloper.org/news/19325</link>
      <description><![CDATA[<p>
In his most recent post <i>Michelangelo van Dam</i> talks about <a href="http://www.dragonbe.com/2013/03/look-mama-no-databases.html">unit testing and databases</a> and how, to effectively test what should be tested (the code, not "the ability to fetch data") you need to correctly mock your database objects.
</p>
<blockquote>
When I state "as is", I truly mean the way it's being used in production. So the database call collects real data on which business logic is applied. You can see this is not a healthy situation, especially when you also have services that apply business logic on data and store it back into the database. In "<a href="https://leanpub.com/grumpy-phpunit?ref=dragonbe>The Grumpy Programmer's PHPUnit Cookbook</a>", author <a href="https://twitter.com/grmpyprogrammer">Chris Hartjes</a> wrote this one sentence that says it all: "Unit test suites are meant to be testing code, not the ability of a database server to return results". And he's right, you shouldn't use database connections when your testing business rules and functional logic.
</blockquote>
<p>
He goes on to show a few code examples that show a pre-mocked state of testing where the Product information is pulled directly from a PDO connection. The more correct version mocks out this object, though, and overrides the "execute" and "fetchAll" methods to return mocked results. 
</p>]]></description>
      <pubDate>Mon, 18 Mar 2013 10:11:46 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Contributing to Paratest]]></title>
      <guid>http://www.phpdeveloper.org/news/19278</guid>
      <link>http://www.phpdeveloper.org/news/19278</link>
      <description><![CDATA[<p>
On DZone.com today there's an update about <a href="http://css.dzone.com/articles/contributing-paratest">recent additions to Paratest</a>, the parallel PHPUnit test runner (created by <a href="https://github.com/brianium/paratest">Brian Scaturro</a>). He talks some about the benefits of running tests in parallel and shares some of the recent contributions to the project from other developers.
</p>
<blockquote>
I've already written about <a href="http://css.dzone.com/articles/parallel-phpunit">my experiments with Paratest</a>. Paratest is a PHPUnit wrapper that allows you to run tests written for PHPUnit in parallel, making us of multiple processes running on the same machine. In a world where cycle time is an important metric, trading resources to get the test suite to finish earlier is a net gain; especially when you're stepping on unstable stones and run the suite very often.
</blockquote>
<p>
He (<i>Giorgio Sironi</i>) has contributed a new test runner to the project - the "WrapperRunner" that limits the number of processes spawned by the parallel testing tool. Another contribution came from <i>Dimitris Baltas</i> involving the addition of a <a href="https://github.com/brianium/paratest/pull/23">TEST_TOKEN variable</a> that can be used to uniquely identify each process as they're executing.
</p>]]></description>
      <pubDate>Wed, 06 Mar 2013 10:16:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Community News: The Grumpy Programmer's PHPUnit Cookbook Released]]></title>
      <guid>http://www.phpdeveloper.org/news/19271</guid>
      <link>http://www.phpdeveloper.org/news/19271</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> (aka the "Grumpy Programmer") has written a second book that aims to teach you even more about writing testable applications. Where his <a href="https://leanpub.com/grumpy-testing">first book</a> taught the basics of making apps testable, this new book - <a href="https://leanpub.com/grumpy-phpunit">The Grumpy Programmer's PHPUnit Cookbook</a> provides code examples showing how to solve some of the common problems you'll come across when testing your applications.
</p>
<blockquote>
You know you need something better, but time just doesn't seem to be on your side. Making things "right" is costly and you need to deliver working code NOW. Tests would be great but there are real deadlines to meet. You can't stop development and churn away for hours just to add tests around what you know already works. [...] No longer would you dread the bug reports. You'd happily make changes knowing that your safety net is there. You'd try out new features guiding yourself with tests.
</blockquote>
<p>
The book covers some more advanced topics than you might have seen in the previous book including data providers, test doubles, faking test data (or using external sources) and writing tests for APIs, databases and exceptions. If this sounds interesting to you, you can <a href="https://leanpub.com/grumpy-phpunit">pick up your own copy</a> of the book on his site (or <a href="http://samples.leanpub.com/grumpy-phpunit-sample.pdf">try out the sample first</a>).
</p>]]></description>
      <pubDate>Tue, 05 Mar 2013 10:17:15 -0600</pubDate>
    </item>
  </channel>
</rss>
