You are here

public static function PHPUnit_TextUI_TestRunner::run in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpunit/phpunit/src/TextUI/TestRunner.php \PHPUnit_TextUI_TestRunner::run()

Parameters

PHPUnit_Framework_Test|ReflectionClass $test:

array $arguments:

Return value

PHPUnit_Framework_TestResult

Throws

PHPUnit_Framework_Exception

File

vendor/phpunit/phpunit/src/TextUI/TestRunner.php, line 77

Class

PHPUnit_TextUI_TestRunner
A TestRunner for the Command Line Interface (CLI) PHP SAPI Module.

Code

public static function run($test, array $arguments = array()) {
  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.');
  }
}