Exemplo n.º 1
0
 /**
  * @param  string  $loaderName
  */
 protected static function handleLoader($loaderName)
 {
     if (!class_exists($loaderName, FALSE)) {
         PHPUnit_Util_Fileloader::checkAndLoad(str_replace('_', '/', $loaderName) . '.php');
     }
     if (class_exists($loaderName, FALSE)) {
         $class = new ReflectionClass($loaderName);
         if ($class->implementsInterface('PHPUnit_Runner_TestSuiteLoader') && $class->isInstantiable()) {
             $loader = $class->newInstance();
         }
     }
     if (!isset($loader)) {
         PHPUnit_TextUI_TestRunner::showError(sprintf('Could not use "%s" as loader.', $loaderName));
     }
     PHPUnit_TextUI_TestRunner::setLoader($loader);
 }