autoload PHPUnit classes
authorChuck Hagenbuch <chuck@horde.org>
Sat, 26 Sep 2009 03:39:57 +0000 (23:39 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Sat, 26 Sep 2009 03:40:40 +0000 (23:40 -0400)
framework/Log/test/Horde/Log/AllTests.php

index b19ccff..33d1f95 100644 (file)
@@ -18,8 +18,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Log_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+if (!spl_autoload_functions()) {
+    spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
+}
 
 /**
  * @category Horde
@@ -40,10 +41,6 @@ class Horde_Log_AllTests
     public static function suite()
     {
         set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path());
-        if (!spl_autoload_functions()) {
-            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); include "$filename.php";'));
-        }
-
         $suite = new PHPUnit_Framework_TestSuite('Horde_Log');
 
         $basedir = dirname(__FILE__);