<?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 05:42:25 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Mike Purcell's Blog: PHPUnit - Upgrade - Convert assertType to assertInternalType]]></title>
      <guid>http://www.phpdeveloper.org/news/17982</guid>
      <link>http://www.phpdeveloper.org/news/17982</link>
      <description><![CDATA[<p>
In <a href="http://melikedev.com/2012/05/18/phpunit-upgrade-convert-asserttype-to-assertinternaltype/">this quick post</a> to his blog, <i>Mike Purcell</i> mentions the deprecation of the "assertType" assertion and includes some code you can add to correct the issue in your tests.
</p>
<blockquote>
We recently upgraded phpunit from a very old version to the current 3.6.x version (at time of writing). During the upgrade I noticed that assertType is no longer supported in many of our tests which were testing if something was a string, an array, or an object. So I had to write a quick script to update assertType to assertInternalType and figured I would post it for others if they needed to do the same.
</blockquote>
<p>
The code goes into each of your tests (recursively) and finds the places where the "assertType" assertion is used and replaces it with its newer cousin "assertIntrnalType". 
</p>]]></description>
      <pubDate>Mon, 21 May 2012 09:56:59 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: How the Testing Sausage Gets Made]]></title>
      <guid>http://www.phpdeveloper.org/news/17970</guid>
      <link>http://www.phpdeveloper.org/news/17970</link>
      <description><![CDATA[<p>
For those either just getting into unit testing your applications (maybe even <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a>) or those that are old hat at it and what to figure out a few more tricks of the trade, you should check out <a href="http://www.littlehart.net/atthekeyboard/2012/05/17/how-the-testing-sausage-gets-made/">this latest post</a> from <i>Chris Hartjes</i> about some of the tools he uses to get the job done.
</p>
<blockquote>
So how does the Grumpy Programmer write code, TDD style? It starts with using a set of tools that reduce the amount of friction required. First, I do almost all my work from a terminal.  [...] Why the terminal? PHPUnit is a CLI application. Yes, many popular editors and IDE's can do things like execute PHPUnit for you, but they are limited in what flexibility they provide. 
</blockquote>
<p>
He also talks about his editor of choice, <a href="http://www.vim.org/">vim</a>, and some of the plugins he uses in his day to day testing development. This includes tools to handle things like interfacing with git/gists, working with ctags to see the code's structure, working with "surroundings" and the <a href="https://github.com/tpope/vim-pathogen">pathogen</a> plugin to make adding other plugins easier. He keeps the code up in one terminal and his testing tool (PHPUnit or other) accessible in a second, making it a simple matter of switching to write the test then the functionality to make it pass.
</p>
<blockquote>
If there is a lesson to be learned from this, it's to make sure that every tool that you use reduces the friction that is generated when building your application using TDD.
</blockquote>]]></description>
      <pubDate>Thu, 17 May 2012 09:19:33 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Unit testing Zend Framework 1]]></title>
      <guid>http://www.phpdeveloper.org/news/17889</guid>
      <link>http://www.phpdeveloper.org/news/17889</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a new post (a quick introduction) about <a href="http://akrabat.com/zend-framework/unit-testing-zend-framework-1/">working with the unit tests</a> in the Zend Framework (version 1), how to get PHPUnit working and execute the tests.
</p>
<blockquote>
As part of our release process for Zend Framework 1.12, I've been working through the unit tests and running them on PHP 5.2.4 as it seems that recent changes weren't being tested with that version. This isn't totally surprising as Open Source contributors are, almost by definition, interested in new things and so are much more likely to be running PHP 5.4 rather than 5.2!
</blockquote>
<p>
Since there's a compatibility issue between the tests and the current versions of PHPUnit, he shows you how to install the 3.4 version instead following <a href="http://tech.vg.no/2011/11/29/running-multiple-versions-of-phpunit/">these instructions</a>. Then, to run the tests, it's a simple call to execute this PHPUnit version with options for outputting to the "standard error", setting an infinite memory limit and pointing to the tests for your component of choice.
</p>]]></description>
      <pubDate>Tue, 01 May 2012 10:54:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Kevin Schroeder's Blog: Remote Debugging with the Zend Debugger and PHPUnit]]></title>
      <guid>http://www.phpdeveloper.org/news/17888</guid>
      <link>http://www.phpdeveloper.org/news/17888</link>
      <description><![CDATA[<p>
<i>Kevin Schroeder</i> has <a href="http://www.eschrade.com/page/remote-debugging-with-the-zend-debugger-and-phpunit/">a quick new post</a> with a one-liner you can use to get remote debugging working with Zend Debugger and PHPUnit.
</p>
<blockquote>
I'm trying to do some remote debugging with PHPUnit on a remote system.  I was following the rules I had <a href="http://www.eschrade.com/page/debugging-a-php-cli-script/">written about in a previous article</a> but for some reason I could not get path mapping to work.  So I figured I'd ping the Studio lead developer because as soon as I did that I'd get it to work.  Well, that's what happened. 
</blockquote>
<p>
His fix comes in the form of setting a command-line parameter, QUERY_STRING, with the correct parameter order so the paths will get mapped back to the correct project. This parameter is a URL-encoded set of parameters that do things like start the debugging, set up the hostname for the debugger to point to and map the "original URL" back to your choice of values.
</p>]]></description>
      <pubDate>Tue, 01 May 2012 09:27:47 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Testing PHP scripts]]></title>
      <guid>http://www.phpdeveloper.org/news/17870</guid>
      <link>http://www.phpdeveloper.org/news/17870</link>
      <description><![CDATA[<p>
In <a href="http://css.dzone.com/articles/testing-php-scripts">this new post</a> to DZone.com, <i>Giorgio Sironi</i> talks about a method of testing that's non-invasive when you're in a chicken-and-egg kind of situation:
</p>
<blockquote>
The legacy code dilemma, however, is always present: you can't refactor the code before putting up some tests on it to avoid regressions and putting your application offline. At the same time, you can't easily unit test the code until some refactoring is introduced.
</blockquote>
<p>
He suggests making copies of some files to allow you to make small changes where needed to "mock" resources in the application to prevent it from accessing the actual data sources. His method fakes HTTP requests to the script and uses the copy of the script as an internal resource. Don't worry, code is included showing how its done - a basic "ForumPosting" class that includes the needed file and wraps the output in a buffer.
</p>]]></description>
      <pubDate>Thu, 26 Apr 2012 10:50:24 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Chris Hartjes' Blog: Metatesting: Extending Your Testing Tools]]></title>
      <guid>http://www.phpdeveloper.org/news/17851</guid>
      <link>http://www.phpdeveloper.org/news/17851</link>
      <description><![CDATA[<p>
<i>Chris Hartjes</i> has had a few posts about "metatesting" already and in <a href="http://www.littlehart.net/atthekeyboard/2012/04/19/metatesting-extending-your-testing-tools/">this latest article</a> he takes the series one more step. He looks at moving outside of the current toolset and expanding on them to meet your testing needs.
</p>
<blockquote>
While <a href="http://phpunit.de/">PHPUnit</a> is awesome out of the box, it still lacks some tools that are required to do things like test protected class methods or assign values to protected class attributes. Lucky for me we have an awesome testing engineer at Kaplan named <a href="https://twitter.com/FreshWillisms">Will Parker</a> who has shown me some ways that they have extended PHPUnit itself to make testing certain things easier.
</blockquote>
<p>
<i>Chris</i> talks about things like testing protected methods (easy thanks to a helper) and checking the value of a class property. The key to both of them lies in using PHP's own <a href="http://php.net/reflection">Reflection</a> functionality to alter properties on the class objects themselves.
</p>]]></description>
      <pubDate>Mon, 23 Apr 2012 11:27:02 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Shashikant Jagtap's Blog: PHPUnit + Behat/Mink + Page Object: The Rockstar Combination of Testing]]></title>
      <guid>http://www.phpdeveloper.org/news/17845</guid>
      <link>http://www.phpdeveloper.org/news/17845</link>
      <description><![CDATA[<p>
Earlier this month <i>Shashikant Jagtap</i> wrote up a post about a powerful combination in testing your applications - a "rockstar" combo of <a href="https://lestbddphp.wordpress.com/2012/04/07/phpunit-behatmink-page-object-the-rockstar-combination-of-testing/">PHPUnit + Behat/Mink + Page Object</a> to give you a great foundation for BDD (behavior-driven) testing.
</p>
<blockquote>
Last month, we had discussion about implementing page object pattern in <a href="https://github.com/Behat/Mink">Behat/Mink</a> framework at <a href="http://www.meetup.com/LondonBehatUsers/">London Behat Users meetup</a>. <a href="http://blog.josephwilk.net/cucumber/page-object-pattern.html">Page object</a> pattern is a cool way to make tests maintainable, reusable and readable. Everyone was interested to know more about Page Object Pattern. In this short tutorial, we will implement Mink and PHPUnit  combination for functional testing. Mink and PHPUnit combined with Pageness (Page Object) can be used for maintainable and readable tests.
</blockquote>
<p>
He assumes that you might not have all the tools needed installed, so he walks you through the setup/install of PHPUnit, the <a href="https://github.com/Shashi-ibuildings/PHPUnit-Mink">PHPUnit-Mink framework</a> and both the <a href="http://sourceforge.net/projects/sahi/">Sahi</a> and <a href="http://seleniumhq.org/download/">Selenium</a> drivers. He includes a basic directory structure for the testing and shows how to create some Page Object classes that extend the default TestCase and make calling the remote resource simple. He also includes the steps needed to execute the tests via PHPUnit.
</p>]]></description>
      <pubDate>Fri, 20 Apr 2012 10:49:54 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: Selenium on Android]]></title>
      <guid>http://www.phpdeveloper.org/news/17835</guid>
      <link>http://www.phpdeveloper.org/news/17835</link>
      <description><![CDATA[<p>
On DZone.com there's a recent post from <i>Giorgio Sironi</i> looking at <a href="http://css.dzone.com/articles/selenium-android">running Selenium tests on the Android platform</a> via the <a href="http://phpunit.de">PHPUnit</a> Selenium interface.
</p>
<blockquote>
Testing web applications is not only based on unit and functional tests for the server-side (PHP, Java) and client-side (JavaScript) components, but also on end-to-end tests like the ones performed with Selenium. Selenium is capable of driving a real browser like Firefox in the same way a user would do, letting you express a test with a series of page to load, element selections, clicks and typed characters. [...] In this tutorial, we'll experiment with the Android Driver and set up a couple of tests to run inside an Android virtual device.
</blockquote>
<p>
He walks you through the basic setup of an Android environment (based on the <a href="http://source.android.com/source/initializing.html">Android SDK</a>) and how to start up the Android driver installed from <a href="http://code.google.com/p/selenium/downloads/list">the Selenium site</a>. An example test is included, showing how to make a request for a test page and checking its title as well as checking that the input from the "keyboard" is successful.
</p>]]></description>
      <pubDate>Wed, 18 Apr 2012 12:43:04 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[DZone.com: The Page Object pattern]]></title>
      <guid>http://www.phpdeveloper.org/news/17795</guid>
      <link>http://www.phpdeveloper.org/news/17795</link>
      <description><![CDATA[<p>
On DZone.com today there's a new tutorial from <i>Giorgia Sironi</i> giving an example of <a href="http://css.dzone.com/articles/page-object-pattern">working with the PageObject pattern</a> and how it's implemented to help with testing in the PHPUnit_Selenium plugin.
</p>
<blockquote>
In the realm of acceptance testing, a possibility for hooking into the application and exercising it end-to-end is to work through a user interface, which nowadays is in more and more cases web-based. The Page Object pattern is a way to model pages (intended as screens) of a web application as independent objects, and give them several responsibilities.
</blockquote>
<p>
The pattern sets up the resources to let you make queries against the page's contents, interacting with elements on the page, running common assertions on the contents and moving around on the site. He gives a more practical example of it in action (again, using PHPUnit_Selenium) to test a login page and evaluate a successful login.
</p>]]></description>
      <pubDate>Tue, 10 Apr 2012 09:05:39 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Bulletproofing Database Interactions with PHPUnit's Database Extension]]></title>
      <guid>http://www.phpdeveloper.org/news/17794</guid>
      <link>http://www.phpdeveloper.org/news/17794</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing you how to <a href="http://phpmaster.com/bulletproofing-database-interactions">test your application's interface with the database</a> using "bulletproof" PHPUnit testing.
</p>
<blockquote>
There's already a great article here that discusses Test Driven Development, but did you know that you can also test the code that interacts with your database? Especially if your application is data intensive, subjecting your CRUD code to a battery of tests is good practice that helps ensure that your application is working correctly. In this article you will be learning how to write database tests in PHP using PHPUnit and its database extension. 
</blockquote>
<p>
Included in the post is an <a href="https://github.com/phpmasterdotcom/BulletproofingDatabaseInteractions/blob/master/schema.sql">example schema</a> and an example of the seed data (defined as XML) for the testing to use as predictable data in its execution. His test class extends <i> PHPUnit_Extensions_Database_TestCase</i> (instead of the usual <i>PHPUnit_Framework_TestCase</i>) and a test for a basic "getArticles" method in his "IArticleDAO" class. By calling the "createXMLDataSet" method, the test loads in the pre-defined XML records and allows the correct evaluation of the assertions,
</p>]]></description>
      <pubDate>Tue, 10 Apr 2012 08:50:10 -0500</pubDate>
    </item>
  </channel>
</rss>

