about me about me
photography photography
software projects software projects
contact me contact me

When writing unit tests, it’s often useful to know the code coverage you’ve achieved to see what proportion of your code you’re exercising. Typically you have to commit your code to version control, so your CI server can pull in your updates and produce coverage reports. This means you sometimes commit incomplete tests, where you might forget to test failure branches (throwing exceptions for example).

code coverage report

Read the rest of this entry »

I occasionally need the list of method parameter matchers when setting assertions via mocks using with(). A completely useless example:

$foo->expects($this->once())
    ->method('setter')
    ->with($this->isType('string'));

Read the rest of this entry »

I originally added this to Wikipedia’s Luhn algorithm page but one of their editors deemed there to be too many language implementations, and so they scrubbed it.

I’m posting it here for other PHP programmers, this might save you a few minutes work.
Read the rest of this entry »

I needed to compile the latest PHP5 from source so I could enable FPM support. The following packages needed installing to successfully complete compilation. Read the rest of this entry »

I was surprised to find PDO sqlite support wasn’t included by default with PHP 5 on my Ubuntu (10.04) virtual machine. You can check which drivers are available with this small snippet of code (assuming you run this from the command line):

foreach (PDO::getAvailableDrivers() as $driver) {
    echo $driver . PHP_EOL;
}

Read the rest of this entry »

04
Mar

PHP UK Conference 2011

posted 2011 // conference, php // 0

I recently attended PHP UK 2011, this was the second PHP UK conference I’ve attended.

PHP UK Conference main auditoriumKey point from last year: this year was much better organised! Everything ran on time, last year we started late and talks over ran. Congrats to the PHP UK team for much improved organisation.

Several talks have been posted on vimeo.

The talks I attended this year:

Read the rest of this entry »