If you’re using Sublime Text 2 w/ my PHPUnit plugin, but you have phpunit installed into a non-standard place (i.e., it isn’t installed into your system path), then keep reading – this change is for you.

You can now tell the PHPUnit plugin where to find phpunit, by adding the following to your PHPUnit.sublime-settings file:

{
    "path_to_phpunit": "/Users/stuart/build/pear/phpunit"
}
3 comments »

I don’t need the ticket that I bought for the PHP NorthWest 2012 conference, as I’m doing one of the tutorial sessions on the Friday. So I’m going to be giving my ticket away to one lucky reader. The ticket is for both the Saturday and the Sunday sessions, and if memory serves covers all the socials too. You’ll have to pay for your own transport and hotels tho, so please don’t enter unless you’re definitely able to travel to the conference if you win.

To win my ticket, leave an interesting PHP or software development-related question in the comments below. The winner will be the question that I think would be the most interesting to answer, and I’ll answer it for you over either lunch or dinner at the PHPNW12 conference. You must leave your comment by 9am BST on Monday 10th September, and I’ll announce the winner on my blog later that day.

So get asking away 🙂

(Please note: comments on my blog are moderated, so if you leave a comment and it doesn’t show up straight away, that’s why).

UPDATE: we have a winner, who I’m currently trying to get in touch with

1 comment »

Tweaking BrowserMob-Proxy

Posted by Stuart Herbert on August 10th, 2012 in Toolbox.

If you’re writing tests for your web-based applications (and if you’re not, I’m sure Chris Hartjes will want a stern word with you …), then you might be using a combination of Selenium 2 / aka Selenium WebDriver and WebMetrics’ BrowserMob-Proxy for your testing.

WebDriver is the latest Selenium API for controlling real web browsers such as Internet Explorer, Firefox and Chrome, and BrowserMob-Proxy adds in essential missing capabilities such as checking HTTP status codes and injecting headers for HTTP Basic Auth.

I’ve recently forked BrowserMob-Proxy on GitHub and started to make tweaks to it for work. Thought I’d mention it, in case anyone else out there is using BrowserMob-Proxy and would find our tweaks useful too. We’ll be submitting our tweaks upstream in due course.

  • Executable JAR – Maven POM file updated to build browsermob-proxy-X.XX-standalone.jar – an executable JAR file – during the ‘package’ phase. Very handy if you’re running and testing it via the remote API. Upstream’s browsermob-proxy-X.XX-bin.zip is still available, and is now always built during the ‘install’ phase.
  • /features endpoint – a new REST API endpoint allowing you to GET and POST and DELETE feature flag settings. We’re using this to enable/disable any new features that might break backwards compatibility, in case you want to use existing BrowserMob-Proxy REST clients with our tweaked version. Said REST clients can also use this to see which features are present / enabled.
  • enhancedReplies – by default, BrowserMob-Proxy isn’t the most chatty of REST services. Switch this feature on (POST ‘enhancedReplies=true’ to /config/enhancedReplies), and now every response includes either a ‘success: TRUE’ or an ‘error: TRUE’ field for your client to easily understand what has happened.
  • More logging – we’ve added some additional log messages throughout the ProxyResource REST API, to make it easier to debug browsermob-proxy REST API clients. This logging is off by default, and is switched on by POSTing ‘paramLogs=true’ to /config/paramLogs, and/or POSTING ‘actionLogs=true’ to /config/actionLogs.
  • additional header GET / DELETE API – we’ve extended the REST API for additional HTTP request headers to now allow you to GET /proxy/:port/header/:name and to DELETE /proxy/:port/header/:name if you need to. You can also delete all additional HTTP request headers in one go by DELETE /proxy/:port/headers.
  • REST API for HTTP Basic Auth – BrowserMob-Proxy’s existing support for HTTP Basic Auth is now available via PUT /proxy/:port/basicAuth/:domain. One of the key features missing from WebDriver. (This is a convenience feature; it could be done by injecting the headers directly into BrowserMob-Proxy).
  • exception handling – by default, BrowserMob-Proxy lets exceptions bubble up to the servlet container … which unfortunately sends back HTML errors rather than a JSON error. To make things a little easier for REST clients, I’ve tweaked the REST API to trap exceptions and return back a (hopefully suitable) error class. This will probably need more tweaking before it provides useful information all the time.

Bookmark this page; I’ll be updating it as we complete more tweaks to BrowserMob-Proxy.

1 comment »

Taken at the Google Campus in London last night:

Right now, everyone is hiring. It’s nuts. In 18 years of being a professional software engineer, I’ve never known a time like it. We’ve gone from a society where it was considered a bit odd to be interested in computers, to a world where software engineering skills are the single-most in demand skill today.

This is what you’re competing against – and this is before Facebook and Microsoft open up their new London offices. So the question is … if you’re someone trying to hire developers for your firm, what are you going to do in the face of this competition?

6 comments »

This Month

August 2012
M T W T F S S
« Jul   Sep »
 12345
6789101112
13141516171819
20212223242526
2728293031