<?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>Sat, 20 Mar 2010 08:23:53 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Federico Cargnelutti's Blog: Testing Zend Framework Action Controllers With Mocks]]></title>
      <guid>http://www.phpdeveloper.org/news/13462</guid>
      <link>http://www.phpdeveloper.org/news/13462</link>
      <description><![CDATA[<p>
In <a href="http://blog.fedecarg.com/2009/11/01/testing-zend-framework-action-controllers-with-mocks/">this new post</a> to his blog today <i>Federico Cargnelutti</i> shows you how to use mock objects to unit test controllers in your Zend Framework application.
</p>
<blockquote>
In this post I'll demonstrate a unit test technique for testing Zend Framework Action Controllers using Mock Objects. Unit testing controllers independently has a number of advantages: you can develop controllers test-first (TDD), develop and test all of your controller code before developing any of the view scripts and helps you quickly identify problems in the controller, rather than problems in one of the combination of Model, View and Controller.
</blockquote>
<p>
He sets up a sample user controller and a test case to go along with it. Drop in a test for the user controller class that uses a "getMock" method to define a mock controller object for the "render" method. He also points out a few issues with this sort of testing in the Zend Framework - the return value of the Zend_Test_PHPUnit_ControllerTestCase, issues throwing exceptions with the Front Controller and a problem with the dispatcher's storage of the Action Controller.
</p>]]></description>
      <pubDate>Mon, 02 Nov 2009 07:58:44 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: PHPUnit with Zend_Controller_Action_Helper]]></title>
      <guid>http://www.phpdeveloper.org/news/12927</guid>
      <link>http://www.phpdeveloper.org/news/12927</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> has <a href="http://www.lornajane.net/posts/2009/PHPUnit-with-Zend_Controller_Action_Helper">posted about</a> another aspect of the REST project she's been developing and an issue that's come up with testing with <a href="http://phpunit.de">PHPUnit</a>.
</p>
<blockquote>
I ran into problems very quickly - when I tried to write the first unit test for the first action in fact! PHPUnit was just dying when I asked it to dispatch() any URL which didn't return HTML, it wasn't even giving its usual output. What was actually happening was I was making use of Zend_Controller_Action_Helper_Json, my service returns JSON and this action helper takes input, transforms it into JSON, sets the content-type correctly and tells ZF not to look for a view since we don't need one. I thought this was pretty neat.
</blockquote>
<p>
As it turns out, there was an <a href="http://php.net/exit">exit</a> being called in the Zend_Controller_Action_Helper_Json component that was causing the request to stop at a certain point. The solution? Chaning the value of the supressExit class variable to stop the behavior.
</p>]]></description>
      <pubDate>Thu, 23 Jul 2009 07:50:20 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Timothy Boronczyk's Blog: What's Wrong with OOP]]></title>
      <guid>http://www.phpdeveloper.org/news/12662</guid>
      <link>http://www.phpdeveloper.org/news/12662</link>
      <description><![CDATA[<p>
In <a href="http://zaemis.blogspot.com/2009/06/whats-wrong-with-oop.html">this new post</a> to his blog <i>Timothy Boronczyk</i> has a few suggestions about what's wrong with the current implementation of object oriented programming in most languages (including PHP).
</p>
<blockquote>
Proponents of Object Oriented Programming feel the paradigm yields code that is better organized, easier to understand and maintain, and reusable. [...] If objects truly model the way people think of things in the real world, then why do people have a hard time understanding and working in OOP? I suspect the problem might be the focus on objects instead of actions.
</blockquote>
<p>
He goes on to explain that, in his opinion, the functionality would be more understandable if it focused on the actions from the user's point of view rather than what the object itself can do.
</p>
<blockquote>
The way some OOP languages (like Java and C#) force objects on the programmer borders on the absurd. [...] Sadly though, that decision isn't left to the programmer who has been tasked with developing and maintaining a system. 
</blockquote>]]></description>
      <pubDate>Thu, 11 Jun 2009 08:44:05 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Jani Hartikainen's Blog: Handling errors in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/12052</guid>
      <link>http://www.phpdeveloper.org/news/12052</link>
      <description><![CDATA[<p>
<i>Jani Hartikainen</i> has <a href="http://codeutopia.net/blog/2009/03/02/handling-errors-in-zend-framework/">written up a new post</a> looking at error handling in one of the more popular PHP frameworks - the Zend Framework.
</p>
<blockquote>
In Zend Framework based applications, error handling is typically done using the error controller, but there are different ways to send the execution to it - some better than others. Let's look at some ways to trigger the error controller and how to have it handle different error conditions.
</blockquote>
<p>
He walks through the steps to create the Error controller, change the front controller to use it and add in a few different kinds of actions to handle the various error types that might come up (like "page not found" or "not authorized"). Errors can then be forwarded to each of the actions by the resource the visitor errored from. Of course, he also mentions that exceptions can do something even better - handle the error without all of that messy forwarding around. (There's an example of that version too).
</p>]]></description>
      <pubDate>Tue, 03 Mar 2009 07:54:59 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Zend Framework in Action forum and errata]]></title>
      <guid>http://www.phpdeveloper.org/news/11921</guid>
      <link>http://www.phpdeveloper.org/news/11921</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has a <a href="http://akrabat.com/2009/02/09/zend-framework-in-action-forum-and-errata/">quick update</a> posted to the PHP in Action blog concerning the site's <a href="http://www.manning-sandbox.com/forum.jspa?forumID=329&start=0">forum</a> and <a href="http://www.zendframeworkinaction.com/errata/">errata</a> sections.
</p>
<blockquote>
Although I'm not posting here much at the moment, I am answering questions about my <a href="http://www.zendframeworkinaction.com/">Zend Framework</a> book in Manning's <a href="http://www.manning-sandbox.com/forum.jspa?forumID=329&start=0">Author Online forums</a>. [...] Also, I have started posting up the <a href="http://www.zendframeworkinaction.com/errata/">errata</a> that we have found on the book's website. If something doesn't make sense, check there first!
</blockquote>
<p>
Those <a href="http://www.manning-sandbox.com/forum.jspa?forumID=329&start=0">forums</a> are quite a busy place with topics about specific parts of chapters to more general Zend Framework questions.
</p>]]></description>
      <pubDate>Tue, 10 Feb 2009 10:21:41 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[DevShed: Displaying User Comments in a Code Igniter Blog Application]]></title>
      <guid>http://www.phpdeveloper.org/news/11614</guid>
      <link>http://www.phpdeveloper.org/news/11614</link>
      <description><![CDATA[<p>
DevShed continues their series creating a simple blogging application with the CodeIgniter framework with <a href="http://www.devshed.com/c/a/PHP/Displaying-User-Comments-in-a-Code-Igniter-Blog-Application/">this part</a> of the series - adding in a display for user comments.
</p>
<blockquote>
In this specific case, the first of these files was defined as a basic controller, and was provided with the ability to paginate the aforementioned blog entries via the corresponding pagination class included with CodeIgniter. However, in its current incarnation, the blog application is pretty limited. It doesn't let users post comments on each blog entry. Thus, in the next few lines I'll be improving the signature of the controller class to address this important issue.
</blockquote>
<p>
The review the code from before (showing the pagination of the blog entries) and add onto it a new comments method and how to create a new view to show the messages visitors to the site have submitted.
</p>]]></description>
      <pubDate>Tue, 23 Dec 2008 11:42:01 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHP in Action: The one-line web framework]]></title>
      <guid>http://www.phpdeveloper.org/news/11582</guid>
      <link>http://www.phpdeveloper.org/news/11582</link>
      <description><![CDATA[<p>
On the PHP in Action blog <a href="http://www.reiersol.com/blog/1_php_in_action/archive/172_the_one-line_web_framework.html">this new post</a> talks about something that's at the core of the front controller for most frameworks - a call to a user function based on the passed in action.
</p>
<blockquote>
The core of your average web framework is a Front Controller. Front Controllers are commonly considered complex and esoteric. That's a myth. I sometimes brag that I can construct a Front Controller in 15 minutes. Actually, it's doesn't take quite that long. In PHP, a Front Controller can be simplified to just one line of code.
</blockquote>
<p>
This one line of code, while a very dangerous thing to actually use in an application, illustrates what a front controller does to forward out the request to the rest of the framework. He revises it with a Zend Framework-ish example that splits the request out into a controller/action method.
</p>]]></description>
      <pubDate>Tue, 16 Dec 2008 12:09:42 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Hooks in Action Helpers]]></title>
      <guid>http://www.phpdeveloper.org/news/11348</guid>
      <link>http://www.phpdeveloper.org/news/11348</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/2008/11/05/hooks-in-action-helpers/">posted this look</a> at using hooks inside of action helpers (a follow-up from his <a href="http://akrabat.com/2008/10/31/using-action-helpers-in-zend-framework/">previous article</a> on action helpers):
</p>
<blockquote>
Hooks are a feature of action helpers that allow you to automatically run code at certain points in the dispatch cycle. Specially, there are two hook functions available for action helpers: preDispatch and postDispatch. These allow you to ensure that some functionality is always run for each request.
</blockquote>
<p>
He creates a simple action helper that grabs a random quote from an array and drops it into a property of the helper. By defining a preDispatch method inside of the helper, the HelperBroker knows to pull the method in an execute it immediate before the rest of the actions are executed. A calls to addHelper with the hooks defined is all it takes to glue it together with the execution.
</p>]]></description>
      <pubDate>Wed, 05 Nov 2008 09:34:40 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Rob Allen's Blog: Using Action Helpers in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/11323</guid>
      <link>http://www.phpdeveloper.org/news/11323</link>
      <description><![CDATA[<p>
<i>Rob Allen</i> has <a href="http://akrabat.com/2008/10/31/using-action-helpers-in-zend-framework/">made a new post</a> today showing off Action Helpers in the Zend Framework.
</p>
<blockquote>
When you have some functionality that needs to be shared across multiple controllers, one method is to use action helpers. Action helpers are very powerful and contain hooks to automatically run when you need them too, but you can ignore all that if you don't need it.
</blockquote>
<p>
He includes how to set up the "helper broker" pointing it at your helper files and a simple helper that multiplies the input times two. This helper is then applied inside of his example action (in an IndexController, of course) and assigned to an output variable in the view. He's included <a href="http://akrabat.com/wp-content/uploads/2008/ZF_Action_Helper_example.zip">a code download</a> as an example.
</p>]]></description>
      <pubDate>Fri, 31 Oct 2008 10:20:06 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Robert Basic's Blog: Starting with Zend Framework - part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/11250</guid>
      <link>http://www.phpdeveloper.org/news/11250</link>
      <description><![CDATA[<p>
<i>Robert Basic</i> has posted the <a href="http://robertbasic.com/blog/2008/10/20/starting-with-zend-framework-part-2/">second part</a> of his introduction to the Zend Framework series (here's <a href="http://www.phpdeveloper.org/news/11208">part one</a>).
</p>
<blockquote>
This post is the second part of my introductory text on Zend Framework, <a href="http://robertbasic.com/blog/2008/10/07/starting-with-zend-framework/">Starting with Zend Framework</a>. This time I cover the basics about controllers, actions, view scripts and view helpers. On request routing and the Front Controller I will write one (or more) big post(s), so this part won't be explained now. I will also skip explaining the models; they deserve their own post.
</blockquote>
<p>
He goes a step further and looks at Controllers - what they are and some intro steps to you making one of your own - and the parts around them, the views, actions and view helpers.
</p>
]]></description>
      <pubDate>Mon, 20 Oct 2008 13:54:25 -0500</pubDate>
    </item>
  </channel>
</rss>
