Update unit tests to PHPUnit.
Fix dodgy unit test.