PHPUnit test failures should cause test run to fail

At present this is based off my PR for test suite refactoring. If that doesn't go ahead, I'll rebase it onto master. 

The basic approach is to extract warnings from PHPUnit run via regex, which is, frankly, terrible. But, even if this is fixed upstream, we'd still need to support older versions of PHPUnit. The regex doesn't catch some multi-line warnings, but at least it provides something to work from.