/** * @param PHPUnit_Framework_Test|ReflectionClass $test * @param array $arguments * * @return PHPUnit_Framework_TestResult * * @throws PHPUnit_Framework_Exception */ public static function run($test, array $arguments = []) { if ($test instanceof ReflectionClass) { $test = new PHPUnit_Framework_TestSuite($test); } if ($test instanceof PHPUnit_Framework_Test) { $aTestRunner = new self(); return $aTestRunner->doRun($test, $arguments); } else { throw new PHPUnit_Framework_Exception('No test case or test suite found.'); } }