<?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, 12 Feb 2012 20:53:32 -0600</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Sebastian Bergmann's Blog: A Tool's Tale]]></title>
      <guid>http://www.phpdeveloper.org/news/17479</guid>
      <link>http://www.phpdeveloper.org/news/17479</link>
      <description><![CDATA[<p>
<i>Sebastian Bergmann</i> has <a href="http://sebastian-bergmann.de/archives/919-A-Tools-Tale.html">shared a presentation</a> he originally gave at an Etsy event covering some of the history behind the popular <a href="http://phpunit.de">PHPUnit</a> tool and the development it's been through.
</p>
<blockquote>
When <a href="http://twitter.com/noahsussman">Noah Sussman</a> asked me to give a <a href="http://codeascraft.etsy.com/etsy-speaker-series/">Code as Craft Technology Talk</a> last week when I was consulting for Etsy I immediately said yes. [...] Just like with <a href="http://sebastian-bergmann.de/archives/915-Testable-Code-Rockstar-Edition.html">a talk that I gave last year</a>, I suddenly had a chain of associations in my head that I just had to follow. And down the rabbit hole I went once more ...
</blockquote>
<p>
He talks about the origins of PHPUnit (and mentions a few other tools), the move from PHP4 to PHP5, a change in version control from SVN to Git and features of the tool including mock objects and data providers. He also notes that not all tests are "good tests" and how, sometimes, backwards compatibility breaks are a good thing.
</p>]]></description>
      <pubDate>Wed, 01 Feb 2012 11:05:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[NetTuts.com: Testing your PHP Codebase with EnhancePHP]]></title>
      <guid>http://www.phpdeveloper.org/news/17431</guid>
      <link>http://www.phpdeveloper.org/news/17431</link>
      <description><![CDATA[<p>
On NetTuts.com today a new tutorial has been posted to help you test your applications and make it a simpler process <a href="http://net.tutsplus.com/tutorials/php/testing-your-php-codebase-with-enhancephp/">using the EnhancePHP framework</a>. <a href="http://www.enhance-php.com/">EnhancePHP</a> is a lightweight Open Source PHP <a href="http://www.enhance-php.com/Content/About-Unit-Testing/">unit testing</a> framework with support for <a href="http://www.enhance-php.com/Content/Mocks-And-Stubs/">mocks and stubs</a>.
</p>
<blockquote>
You know it; I know it. We should be testing our code more than we do. Part of the reason we don't, I think, is that we don't know exactly how. Well, I'm getting rid of that excuse today: I'm teaching you to test your PHP with the <a href="http://www.enhance-php.com/">EnhancePHP</a> framework.
</blockquote>
<p>
He shows you how to download it, get it installed and creates a simple structure to do some TDD (Test-Driven Development) with it. His tests check three things - valid email addresses, username restrictions and phone number formatting. He also includes a look at creating mocks/stubs for a "scoreboard" example.
</p>
<p>
You can find out more about the EnhancePHP framework on <a href="https://github.com/Enhance-PHP">its github page</a>.
</p>]]></description>
      <pubDate>Mon, 23 Jan 2012 09:25:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: PHPUnit_Selenium]]></title>
      <guid>http://www.phpdeveloper.org/news/17424</guid>
      <link>http://www.phpdeveloper.org/news/17424</link>
      <description><![CDATA[<p>
On DZone.com today <i>Giorgio Sironi</i> has a quick tutorial showing you how to set up and use the <a href="http://css.dzone.com/articles/phpunitselenium">PHPUnit_Selenium</a> component in the latest releases of the <a href="http://phpunit.de">popular testing software</a>.
</p>
<blockquote>
With the 1.2 release, PHPUnit_Selenium supports (basically) for the first time the Selenium 2 WebDriver API. While PHPUnit_Selenium already worked with Selenium 2, it did so only by using the Selenium 1 emulation included in the jar; now it provides an object-oriented API right natively supported in a base PHPUnit test case, shipped in PHPUnit's PEAR channel.
</blockquote>
<p>
He includes the steps you'll need to pull it from the PEAR channel and how to set up a test case based on the PHPUnit_Extensions_Selenium2TestCase object. He gives a few examples of how to select various components on the page (via CSS selectors and XPath), assert that the right information is there and interact with forms.
</p>]]></description>
      <pubDate>Fri, 20 Jan 2012 09:12:18 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Kurt Payne's Blog: How to Unit Test pcntl_fork()]]></title>
      <guid>http://www.phpdeveloper.org/news/17421</guid>
      <link>http://www.phpdeveloper.org/news/17421</link>
      <description><![CDATA[<p>
<i>Kurt Payne</i> has a new post to his blog showing how you can <a href="http://kpayne.me/2012/01/17/how-to-unit-test-fork/">unit test your process forking</a> in your PHP application (<a href="http://php.net/pcntl">pcntl</a>).
</p>
<blockquote>
At some point, many php developers turn to the pcntl functions in php to write a daemon, or server, or simulate threading. But how do you unit test this with complete code coverage? [...] We need to engage some black arts php extensions to make this happen.  An installation guide follows, and the post ends with a complete listing of the unit test.
</blockquote>
<p>
He uses the <a href="https://github.com/sebastianbergmann/php-test-helpers">test_helpers</a> extension (as provided by <i>Sebastian Bergmann</i>) and <a href="https://github.com/zenovich/runkit/">Runkit</a> to allow the test to define new methods copying the current pcntl methods and mocks up the responses. Tests are included to check the parent of a process, checking the children of a process and testing that a fork could be made. Hes's even included <a href="http://kurtpayne.files.wordpress.com/2012/01/forktest_code_coverage.png?w=614&h=464">visual proof</a> of this working.
</p>]]></description>
      <pubDate>Thu, 19 Jan 2012 13:40:20 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: PHPUnit Aborted Fix]]></title>
      <guid>http://www.phpdeveloper.org/news/17419</guid>
      <link>http://www.phpdeveloper.org/news/17419</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> ran into an issue with hit unit tests where <a href="http://phpunit.de">PHPUnit</a> was throwing an "aborted" error no matter what tests were run. Thankfully, in <a href="http://www.littlehart.net/atthekeyboard/2012/01/17/phpunit-aborted-fix/">this new post</a>, he shares a solution.
</p>
<blockquote>
That was a pretty annoying bug. I never did find out what the problem was as I moved onto other problems and chalked that error up to some undiagnosed weirdness on that particular server. From time to time I would get asked on Twitter if I had ever solved the problem. My answer was always "no, and if you do solve it please let met know how you fixed it." Today, my friends, was the day.
</blockquote>
<p>
Based on a response from <a href="https://twitter.com/demiankatz">Demian Katz</a>, he was able to get around the issue with flag set on the PHPUnit command line - "-dzend.enable_gc=0". Apparently the issue has to do with <a href="https://bugs.php.net/bug.php?id=53976">garbage collection</a> and has been a known issue since the beginning of 2011.
</p>]]></description>
      <pubDate>Thu, 19 Jan 2012 11:16:53 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Fabien Potencier's Blog: Create your own framework... on top of the Symfony2 Components (part 8)]]></title>
      <guid>http://www.phpdeveloper.org/news/17404</guid>
      <link>http://www.phpdeveloper.org/news/17404</link>
      <description><![CDATA[<i>Fabien Potencier</i> has posted the <a href="http://fabien.potencier.org/article/57/create-your-own-framework-on-top-of-the-symfony2-components-part-8">eighth part</a> in his "building a framework on Symfony2 components" series. So far he's created a <a href="http://fabien.potencier.org/article/50/create-your-own-framework-on-top-of-the-symfony2-components-part-1">full</a>-<a href="http://fabien.potencier.org/article/51/create-your-own-framework-on-top-of-the-symfony2-components-part-2">featured</a> <a href="http://fabien.potencier.org/article/52/create-your-own-framework-on-top-of-the-symfony2-components-part-3">microframework</a> with <a href="http://fabien.potencier.org/article/53/create-your-own-framework-on-top-of-the-symfony2-components-part-4">routing</a>, <a href="http://fabien.potencier.org/article/54/create-your-own-framework-on-top-of-the-symfony2-components-part-5">controllers</a>, <a href="http://fabien.potencier.org/article/55/create-your-own-framework-on-top-of-the-symfony2-components-part-6">HTTP handling</a> and <a href="http://fabien.potencier.org/article/56/create-your-own-framework-on-top-of-the-symfony2-components-part-7">namespaced code</a>. In this latest part he improves the sample framework by adding some unit tests.
</p>
<blockquote>
Some watchful readers pointed out some subtle but nonetheless important bugs in the framework we have built yesterday. When creating a framework, you must be sure that it behaves as advertised. If not, all the applications based on it will exhibit the same bugs. The good news is that whenever you fix a bug, you are fixing a bunch of applications too. Today's mission is to write unit tests for the framework we have created by using <a href="http://www.phpunit.de/manual/current/en/index.html">PHPUnit</a>.
</blockquote>
<p>
He includes the XML for a basic phpunit.xml configuration file and uses a UrlMatcher and ControllerResolver in a "Framework" class and makes the test check for "not found" URLs and for checking for a correct Response.
</p>]]></description>
      <pubDate>Tue, 17 Jan 2012 09:39:26 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Running VisualPHPUnit in Windows Azure]]></title>
      <guid>http://www.phpdeveloper.org/news/17377</guid>
      <link>http://www.phpdeveloper.org/news/17377</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has posted another in his "unit testing on Azure" posts to his blog today. This time he shows how to <a href="http://blogs.msdn.com/b/silverlining/archive/2012/01/10/running-visualphpunit-in-windows-azure.aspx">get VisualPHPUnit running</a> on your Windows Azure installed code.
</p>
<blockquote>
Last month, I wrote <a href="http://blogs.msdn.com/b/silverlining/archive/2011/12/05/thoughts-on-testing-oss-applications-in-windows-azure.aspx">a post that outlined 3 ways to test PHP applications in Windows Azure</a>, and since then I've covered two of those approaches: <a href="http://blogs.msdn.com/b/silverlining/archive/2011/12/07/running-phpunit-in-windows-azure.aspx">Running PHPUnit in Windows Azure</a> (uses RDP) and <a href="http://blogs.msdn.com/b/silverlining/archive/2012/01/03/automating-phpunit-tests-in-windows-azure.aspx">Automating PHPUnit Tests in Windows Azure</a>. In this post I'll cover how to use a web-front end (<a href="https://github.com/NSinopoli/VisualPHPUnit">VisualPHPUnit</a> specifically) to run tests in Azure.
</blockquote>
<p>
The process is really simple - it's basically three steps (after the VisualPHPUnit install): 
</p>
<ul>
<li>Edit the configuration file to point to the right tests directory
<li>Password protect the VisualPHPUnit directory
<li>Deploy your application by following the instructions <a href="http://blogs.msdn.com/b/silverlining/archive/2011/11/23/packaging-a-custom-php-installation-for-windows-azure.aspx">here</a>
</ul>]]></description>
      <pubDate>Wed, 11 Jan 2012 10:25:43 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevHell Podcast: Episode 3: Beatings Will Continue Until Test Coverage Improves]]></title>
      <guid>http://www.phpdeveloper.org/news/17373</guid>
      <link>http://www.phpdeveloper.org/news/17373</link>
      <description><![CDATA[<p>
The latest episode of the DevHell podcast has been posted - <a href="http://devhell.info/post/2012-01-07/beatings-will-continue-until-test-coverage-improves/">Episode 3</a>, "Beatings Will Continue Until Test Coverage Improves".
</p>
<blockquote>
Fresh off our holiday break, we're back with our longest show yet. We talk about Chris' new book <a href="http://leanpub.com/grumpy-testing">The Grumpy Programmer's Guide To Building Testable PHP Applications</a>, including his experiences self-publishing with Leanpub. Chris also explains how he fears no precipitation on his excursions to the Codemash conference in Ohio. Then Ed talks about the thought process that lead to his latest shit-stirring blog post "<a href="http://funkatron.com/posts/the-microphp-manifesto.html">The MicroPHP Manifesto</a>." Ed may or may not begin crying openly. Finally, we discuss when it might be necessary to trash your existing application and rewrite it.
</blockquote>
<p>
You can listen to this latest episode either via the <a href="http://devhell.info/post/2012-01-07/beatings-will-continue-until-test-coverage-improves/">in-page player</a> or by <a href="http://devhell.s3.amazonaws.com/ep3-64mono.mp3">downloading the mp3 directly</a>.
</p>]]></description>
      <pubDate>Tue, 10 Jan 2012 13:58:03 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Brian Swan's Blog: Running PHPUnit in Windows Azure]]></title>
      <guid>http://www.phpdeveloper.org/news/17236</guid>
      <link>http://www.phpdeveloper.org/news/17236</link>
      <description><![CDATA[<p>
<i>Brian Swan</i> has a recent post to his MSDN blog about <a href="http://blogs.msdn.com/b/silverlining/archive/2011/12/07/running-phpunit-in-windows-azure.aspx">setting up PHPUnit for testing</a> on a Windows Azure platform (as installed via PEAR).
</p>
<blockquote>
After figuring out how to run PHPUnit from the command line in a Windows Azure instance, I did find that a bit more configuration work than I anticipated was necessary. I'm not 100% certain that this is the best way to run PHPUnit in Windows Azure, but it is one way. I'd be interested in hearing better ways to do this.
</blockquote>
<p>He breaks it up into a few different steps:</p>
<ul>
<li>Building the application with your tests locally
<li>Package the application up for Azure deployment
<li>Enable RDP access on your Azure instance
<li>Find your PHP and PEAR install on your instance and, logged in via RDP, add their locations to your current path
<li>Edit the phpunit.bat file to point to the right PHP location
<li>Execute the tests!
</ul>
<p>
For other options for testing Azure-based applications, see <a href="http://blogs.msdn.com/b/silverlining/archive/2011/12/05/thoughts-on-testing-oss-applications-in-windows-azure.aspx">Brian's previous post</a>.
</p>]]></description>
      <pubDate>Fri, 09 Dec 2011 10:08:47 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[VG Tech Blog: Mocking the File System Using PHPUnit and vfsStream]]></title>
      <guid>http://www.phpdeveloper.org/news/17235</guid>
      <link>http://www.phpdeveloper.org/news/17235</link>
      <description><![CDATA[<p>
On the VG Tech blog today there's another post related to unit testing (<a href="http://phpdeveloper.org/news/17229">here's</a> one from before) but this time they're talking about <a href="http://tech.vg.no/2011/03/09/mocking-the-file-system-using-phpunit-and-vfsstream/">mocking the filesystem with vfsStream</a>, a powerful tool that lets you interact with PHP streams as a virtual file system.
</p>
<blockquote>
This article is about how to mock the file system when writing unit tests, and it will be rather code-heavy. [...] <a href="http://phpunit.de/">PHPUnit</a> is the de-facto standard for unit testing in PHP projects, and this is what we will be using together with <a href="http://code.google.com/p/bovigo/wiki/vfsStream">vfsStream</a> in this article.
</blockquote>
<p>
The include the code for a simple storage driver (VGF_Storage_Driver_Filesystem) to use with vfsStream  with "store", "delete" and "get" methods. Also included are examples of using vfsStream to check things like directory existence, if a file exists, or if a file can be read. A few simple assertions are set up in their sample test to check the methods in their "VGF_Storage_Driver_Filesystem" class.
</p>]]></description>
      <pubDate>Fri, 09 Dec 2011 09:40:13 -0600</pubDate>
    </item>
  </channel>
</rss>

