RFC: Mocking protected methods

Update, 2011-06-16, 12:15 AM Thanks for the comments. (I swear I had something like that before and it didn’t work!) Here’s the solution: — Original blog entry — I wrote a couple tests for a small CouchDB access wrapper today. But when I wrote the implementation itself, I realized that my class setup depends on an actual CouchDB server being available and here my journey began. Example code Consider the following example:...

June 15, 2011 · 1 min

Dependency Injection Containers

I got into a discussion on Twitter the other day where I mentioned that I don’t like DI. Call it lack of sleep or language barrier (on my part), but I said DI — dependency injection — when I meant the dependency injection container. Having said this, let me explain why I don’t like it. POV Despite not working for any of the larger PHP joints out there, I get to spend my time with pretty interesting stuff....

May 30, 2011 · 3 min

VirtualBox Guest Additions and vagrant

If you followed my blog, you probably know about chef and vagrant. So the other day I managed to upgrade to VirtualBox 4.0. The upgrade just happened by accident, so to speak. I noticed that Virtualbox 4.0 had moved from nonfree to contrib on Oracle’s repository which is why I had previously missed it. With 4.0, I am now able to run the latest and greatest Vagrant — and with Vagrant being pre-1....

May 24, 2011 · 3 min

Yahoo: oauth_problem=consumer_key_rejected

Here’s how I literally wasted eight hours of my life. :-) We signed up for Yahoo! Search Boss last week. The process itself was pretty straight: Sign into your Yahoo! account at https://developer.apps.yahoo.com/ Click “New Project”, fill out the form. Then click on the project name, activate “Yahoo! Search Boss” by suppling some billing info. Consumer key rejected? The above process doesn’t even take five minutes, but then I spent eight hours figuring out what oauth_problem=consumer_key_rejected means....

May 22, 2011 · 4 min

Some thoughts on outtages

Cloud, everybody wants it, some actually use it. So what’s my take away from AWS’ recent outtage? Background So first off, we had two pieces of our infrastructure failing (three if we include our Multi-AV RDS) — both of which involve EBS. Numero uno One of those pieces in my immediate reach was a MySQL server, which we use to keep sessions. And to say the least about AWS and in their defense, the instance had run for almost 550 days and had never given us much or any reason to let us down....

April 23, 2011 · 8 min