Capturing screenshots with Mink, Sahi and PhantomJS

Following on from my previous post Headless Behat/Mink testing with Sahi and PhantomJS, I wanted to complete the final part of Ryan’s post concerning capturing a screenshot of the page which has failed a test. I had hoped this would be fairly simple, but the march of technology has made Ryan’s post almost obsolete. Also, I am not  fan of his technique, with involves injecting an element into the page from the Phantom setup script. This causes problems if your tests want to move between pages. read more »

Testing Tutorial

Headless Behat/Mink testing with Sahi and PhantomJS

We have been using Behat for acceptance testing at work for a while now, but rather informally. I have been interested in it from a CI point of view, especially as our longer term plan is to automate the deployment of several sites from a single codebase. A barrier to this, and to our more recent desire to use Vagrant for controlling our dev environments, was the way in which we were running JavaScript tests using Selenium and Firefox. Today, I decided to cut off the head. read more »

Doctrine PHP Tutorial Zend Framework

Setting up Doctrine with Zend Framework 2

For this post I am working though Jason Grimes’s article http://www.jasongrimes.org/2012/01/using-doctrine-2-in-zend-framework-2/, which in turn is based on Rob Allen’s Album tutorial. The goal is to set up The Doctrine ORM module in Zend Framework 2, and get it working with a simple example. read more »

PHP Zend Framework

Exploring SOAP in Zend Framework 2

At work we have designed a collection of SOAP services using ZF1. This has been great fun, and I’ve learned a lot considering that I hadn’t ever seen a WSDL before May this year. Now though, ZF2 is stable, and after hearing a lot about it at PHPNW I’ve been eager to try it. Rather than waiting for someone else to figure out the differences in the SOAP implementation for me, I’ve decided to jump in myself and learn about ZF2 on the way.

I spoke briefly about this to @Akrabat at PHPNW12, and he has set me down the path of intercepting the bootstrap phase to run the soap server before an action controller gets created.

I’ll be posting my findings here as I make progress, but welcome any input from anyone who has already done work with SOAP in ZF2.


Looking back on PHPNW2012

Nearly a week has passed since PHPNW12, and I’m pleased to find that the the good feeling is still with me. PHPNW12 was the first developer conference I’ve ever attended, and it was an awesome experience. I’m very grateful to everyone who made it so cool, from the organisers and volunteers to the interesting speakers and the friendly crowd. read more »


Deleting old tags in Concrete5

When you first set up your Concrete5 site, you have the option to start with a completely empty site, or one that is populated with minimal content.  I chose the latter option because it would come with a blog already set up.  What I didn’t realise was how hard it would be to delete the tags that come with the dummy blog post.

I had naively assumed that deleting tags would be done through the admin interface.  If it is, I cannot find it.  However, despite having deleted the dummy blog post, I was left with the tags still displaying in my tags list.  Deciding that this aggression would not stand, I rolled up my sleeves and delved into the database.

Paydirt was hit in the atSelectOptions table, which lists every tag in use on the site.  Deleting the old tags (and some that I’d created in error) was now as easy as removing all the offending rows, but I can’t help but feel that this is something that any user should be able to do.

ActionScript Flash

Loader vs URLLoader

Today I tried to load an image, and I failed.  I failed because I was trying to use the URLLoader class.  As I discovered this won’t work, because although it will perform a load and happily dispatch a complete event, it doesn’t have the facility to display anything.

What you need for displaying is the Loader class, or more specifically it’s content property, which is a DisplayObject.  Like so:

// create new Loader object
var myLoader = new Loader();
// set up a listener
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
// trigger the load
myLoader.load(new URLRequest("my_image.gif"));
// load complete handler
function onLoadComplete(evt:Event):void
// clean up the listener
evt.target.contentLoaderInfo.removeEventListener(Event.COMPLETE, onLoadComplete);
// add the image to the display

So basically the difference is this: Loader for display objects, URLLoader for data connections.


Auto-Save for Flash

My CS4 just crashed.  Again.  Although I try to be good about saving, sometimes I get focused on what I’m doing, and it’s always at these times when Flash decides that clicking that last frame was in some way offensive.  Much swearing ensues and a short break is taken, then I begin that complex string of animations again.

This time though I thought to employ google, and turned up a neat little extension on flashguru: Flash Auto-Save.

Pay no attention to the comment about it not working on CS4, I’ve installed it and it works fine.  The only thing to be aware of is that it needs to be visible at all times, and hiding it in a panel group will stop it working.

I hope this saves more people a bit of fury.


Find SWF dimensions with PHP

Wow, so it’s been a long time since I posted here.  It’s quite alarming to think how much has happened since March 2008!  Hopefully I’ll start posting here more often again, more as a written record of things I’ve found useful that will benefit me.  With that in mind,  here’s something that came up today.  It’s a very simple thing, but I’m going to find it very useful in developing the banner section of Biff’s portfolio site.

It is possible to find the dimensions of a SWF using PHP’s  getimagesize() function.  Here’s an example:



Back to basics

Have you ever considered how bewildering the world would seem to a baby, with so much unexplained? That’s how I feel right now.

Having finally got round to trying something, anything, on my Red Hat box, I decided that I should install Python. As if learning one new thing isn’t hard enough, I wanted to learn by doing something else I had no idea how to do. Great idea. I had forgotten that there was once a day that I didn’t know DOS commands until the LINUX terminal was in front of me and I had to navigate to a folder, now I know how my parents feel.