Tag: zend-framework
Testing Zend Framework MVC Applications
Since I originally started hacking on the Zend Framework MVC in the fall of 2006, I've been touting the fact that you can test ZF MVC projects by utilizing the Request and Response objects; indeed, this is what I actually did to test the Front Controller and Dispatcher. However, until recently, there was never an easy way to do so in your userland projects; the default request and response objects make it difficult to easily and quickly setup tests, and the methods introduced into the front controller to make it testable are largely undocumented.
So, one of my ongoing projects the past few months has been to create an infrastructure for functional testing of ZF projects using PHPUnit. This past weekend, I made the final commits that make this functionality feature complete.
The new functionality provides several facets:
- Stub test case classes for the HTTP versions of our Request and Response objects, containing methods for setting up the request environment (including setting GET, POST, and COOKIE parameters, HTTP request headers, etc).
-
Zend_Dom_Query
, a class for using CSS selectors (and XPath) to query (X)HTML and XML documents. - PHPUnit constraints that consume
Zend_Dom_Query
and the Response object to make their comparisons. - A specialized PHPUnit test case that contains functionality for bootstrapping an MVC application, dispatching requests, and a variety of assertions that utilize the above constraints and objects.
Migrating OOP Libraries and Frameworks to PHP 5.3
With PHP 5.3 coming up on the horizon, I'm of course looking forward to using namespaces. Let's be honest, who wants to write the following line?
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
when the more succinct:
$viewRenderer = HelperBroker::getStaticHelper('viewRenderer');
could be used? (Assuming you've executed 'use Zend::Controller::Action;'
somewhere earlier…)
However, while namespaces will hopefully lead to more readable code, particularly code in libraries and frameworks, PHP developers will finally need to start thinking about sane standards for abstract classes and interfaces.
DPC08 Wrapup
Last Friday and Saturday I spent at the Dutch PHP Conference, hosted by Ibuildings. Unfortunately, I had very little time to blog while there. I'd prepared my outlines and basic slides before heading to the conference, but had a large number of screenshots and images to prepare that kept me up until the wee hours of the morning each day. In addition, the conference was extremely well organized — which meant that any time not spent speaking was spent interacting with attendees or other speakers — never a bad thing!
Zend Framework/Dojo Integration QA Slides
We had our Zend Framework/Dojo integration QA today. Aside from some connectivity issues at the beginning of the presentation, things went smoothly, and there were some good questions.
A number of people reported missing the slides or that the slides were not advancing. I'm posting them here; they will also be available on the Zend.com webinars page later this week.
Update: For those who want to view online, you can now do so at SlideShare.
ZF Subversion Reorganization
If you've found that your SVN checkouts or svn:externals
of Zend Framework are not working currently, then you missed the announcements on fw-general
and #zftalk
; I've just completed a Subversion Reorganization that is part of our new proposal process and 'Extras' offering. Please follow the link for details on how to update your installs.
Zend Framework Dojo Integration
I'm pleased to announce that Zend Framework will be partnering with Dojo Toolkit to deliver out-of-the-box Ajax and rich user interfaces for sites developed in Zend Framework.
First off, for those ZF users who are using other Javascript toolkits: Zend Framework will continue to be basically JS toolkit agnostic. You will still be able to use whatever toolkit you want with ZF applications. ZF will simply be shipping Dojo so that users have a toolkit by default. Several points of integration have been defined, and my hope is that these can be used as a blueprint for community contributions relating to other javascript frameworks. In the meantime, developers choosing to use Dojo will have a rich set of components and integration points to work with.
The integration points we have defined for our initial release are as follows:
Speaking at the Dutch PHP Conference
I've known for some time, but was reluctant to blog about it until the plane tickets were purchased and in hand: I've been invited to speak at the Dutch PHP Conference this coming June:
I'll be presenting two separate sessions: an all day tutorial on 13 June 2008 covering Zend Framework, and a regular session on 14 June 2008 covering Best Practices for PHP development, which will focus on how to utilize Zend Framework coding standards and methodologies to help deliver efficient, high quality code for your organization.
I'm looking forward to meeting old and new friends alike at the conference!
Form Decorators Tutorial posted
As a continuing part of my MVC series, I've posted a new article on Form Decorators up on the DevZone.
I'm hoping this will be the definitive guide to using form decorators. I cover the design decisions behind them, basics of operation, how to customize output by mixing and matching standard decorators, and how to create your own custom decorators. Among the examples are how to create a table-based layout for your forms (instead of the dynamic list layout used by default), and how to use a View Script as your form decorator in order to have full control over your form layout.
So, if you've been playing with Zend_Form
and having trouble wrapping your
head around decorators, give it a read!
Zend Framework Q&A Session
With 1.0 and 1.5 of Zend Framework now released, there are a lot of questions flying around -- what will we do next, what components to expect, what are some of the best practices, etc. So, we're going to have an open Question and Answer Session webinar, with all of us on the internal team.
If you have a question you want answered, please be kind enough to submit your question in advance, so we have time to actually think about it (though you can always broadside us during the webinar).
Sign up in advance so you don't miss out!
View Helpers Tutorial on DevZone
I have another tutorial in my Zend Framework MVC series up on DevZone today, this time on View Helpers. If you're curious on how to create view helpers, override the standard view helpers, or how some of the standard view helpers such as partials and placeholders work, give it a read!