Wordpress-tests' WP_PHPUnit_Text_UI Throws Unhandled Exceptions

Description

Summary
In Wordpress-test's boostrap.php, the WP_PHPUnit_TextUI_Command class extends the PHPUnit test runner class simply to parse command line arguments and find some specific ones. PHPUnit's test runner is not actually be used for any other reason.

If it encounters command line arguments that PHPUnit doesn't recognize, an unhandled exception occurs. This is problematic for a couple reasons (see problem details), but the most important one is that enforcing the correct PHPUnit command line arguments is out of the scope of this particular code. If there is a problem, it might be better if it were handled by PHPUnit and not this Wordpress class that we're just using to find specific arguments.

Problem Details

Currently the WP_PHPUnit_TextUI_Command constructor contains a code snippet cribbed directly from the PHPUnit_Text_UI_Command::handleArguments() method.

This works fine when you run PHPUnit directly (and correctly). If you try to use one of a handful of different integration or continuous testing tools, PHPUnit is not being run directly from the command line and so unhandled exceptions will occur until boostrap.php is modified by hand.

Specific use case
Trying to use the MakeGood plugin for Eclipse as a tool for continuous testing will cause unhandled exceptions and prevent testing from happening. Here's what MakeGood does...

PHPUnit won't recognize --no-ansi (if not a few other things) and an exception is thrown.

Proposed Solution
Loop through ARGV directly and call longOption on each one, catching the exceptions thrown by any errors but not acting on them. Dealing with bad command line parameters is something that is either handled earlier or later, by PHPUnit.

Also, instead of extending the PHPUnit runner class, just go directly to the source and extend PHPUnit_Util_Getopt.