Getting familiar with PHPUnit Mocks
As you may or may not know CakePHP is transitioning to PHPUnit and with this transition comes a totally new Mock object interface/implementation.
As you may or may not know CakePHP is transitioning to PHPUnit and with this transition comes a totally new Mock object interface/implementation.
In the past I’ve used a variety of tools to deploy client sites, most often using version control. However, for my blog I’ve always used FTP. Its a pretty old-school approach, and something that I’ve been lacking the time to correct. Last weekend I finally took the plunge and figured out how to get Capistrano to deploy my site.
In the recent bakery article concerning the ongoing development of CakePHP 2.0. The already underway migration from SimpleTest to PHPUnit was introduced. I wanted to go into some of the reasons and motivations for that decision as well as explain some of the long term benefits.
Normally when people think of the App class, they think of a file loader. However, App is also able to introspect your application and provide information about the resources it contains.
Errors and error reporting an important part of the development and debugging cycle. In interpreted languages, there are a number of runtime errors that can really help you debug your code. Some languages like python don’t give you a way to make the errors go away, but for better or worse PHP does.
NoSQL datasources are becoming a bigger part of our everyday life as web developers. If you haven’t heard about it before, MongoDB is a SQL free database built in C++.
I’ve just released another plugin for CakePHP. This one helps reduce the number of HTTP requests made by helping you concatenate and compress your asset files. I’ve been working on it on and off for about 3 months now, and am pretty happy with where it is. It includes both server side and client side libraries for loading compressed files.
I’ve been doing many of the CakePHP releases, since “the great framework apocalypse of imminent doom”. Between then and now, CakePHP has had quite a few releases. During these past few months, I’ve really begun to understand the value of a simple release process. When I initially started doing releases for CakePHP, our release process involved many steps and I was doing them all manually.
Over the long Ontario weekend, I took some time to update Acl Extras. It now works with plugins and the improvements made to the Auth + Acl for 1.3. The master
branch contains the CakePHP 1.3 compatible version. While the 1.0.0
tag, and 1.0 branch are still compatible with CakePHP 1.2.
Its been a few weeks of working in the evenings but its pretty much done. I’ve been wanting to do this redesign for a while now. 2 years ago when I built the version of this domain you’ve all come to know, I attempted to create a design that was different from other programming blogs, and fused my interests in both design and programming. I feel it turned out well.
New for CakePHP 1.3 is the ability to create and use custom route classes for your application’s routing. In the past the router did double duty, managing route collections and routes were just arrays. In 1.3 Router underwent some surgery and CakeRoute
was extracted as an object to represent a single route. While Router
was left as a manager of routes.
I recently read “Clean Code” by Robert Martin an excellent book on writing clear, easy to maintain and well factored code. In it Robert Martin raises the point that methods should do what their names say, shouldn’t have ‘flag arguments’, and should do only one thing. This implies that overloaded methods are out.
You may have seen the Analog.coop site recently and found some of the easter eggs, like the grid hot keys. I loved the concept, and made a mental note to spend some time reverse engineering/rebuilding it for my own uses. Well it just so happens that the guys at Analog have released the #grid on Github, which is great because it made it easier for me to adapt the code and do some small improvements.
Earlier today I tagged and packaged up the 1.2 release of DebugKit. DebugKit 1.2 features a number of improvements and features over 1.1 which include:
Last night I updated this site to run on the latest 1.3 build. While I know I should have done it earlier, I simply haven’t had the time. And since I went through it, I figured I could document it and share what the upgrade process is like for a small site, that doesn’t see a ton of maintenance action like this one.
I’ve been working on a client project that involved some reasonable amount of SVG/VML work. In order to make my life more sane, I’ve been using Raphaël JS to do what it does best, which is provide a great API for making sexy vector graphics.
Everyone can breath a sign of relief. Late last night there were rumours that CakePHP had died. Confusion and disbelief spread pretty quickly through twitter, and IRC. However, CakePHP is doing great, and is very far from dead.
Creating ajax pagination has gotten more simple and flexible for 1.3. In 1.2 you could only use the built in Ajax pagination if you were using Prototype as your javascript library. With the addition of the JsHelper
you can use any Javascript library that an engine has been implemented. My example today will be using mootools. I’ll be basing this, off of a freshly baked index view using the default core templates.
Although PHP5.3 is still hot off the press, and a very exciting release in its own right. I must say I’m far more excited about the grafts and traits that have been proposed for PHP6. While PHP6 is still a fair ways off from being released, Stefan Marr has backported the changes to PHP5.
Shells are one of the more difficult objects to properly unit test. Since they normally run in a CLI context instead of a web context they provide some interesting challenges. The biggest hurdles are separating the Shell from the CLI environment, and simulating the correct arguments and parameters.