Require PHPUnit/Framework.php and put autoloading back in its original place
authorChuck Hagenbuch <chuck@horde.org>
Tue, 29 Sep 2009 13:32:35 +0000 (09:32 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Tue, 29 Sep 2009 13:33:15 +0000 (09:33 -0400)
framework/Http/test/Horde/Http/AllTests.php
framework/Injector/test/Horde/Injector/AllTests.php
framework/Log/test/Horde/Log/AllTests.php

index aba3896..e2aadf5 100644 (file)
@@ -11,11 +11,11 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Http_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework/TestSuite.php';
+require_once 'PHPUnit/Framework.php';
 require_once 'PHPUnit/TextUI/TestRunner.php';
 
-class Horde_Http_AllTests {
-
+class Horde_Http_AllTests
+{
     public static function main()
     {
         PHPUnit_TextUI_TestRunner::run(self::suite());
index dc49faa..0bbbf87 100644 (file)
@@ -8,9 +8,8 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Injector_AllTests::main');
 }
 
-if (!spl_autoload_functions()) {
-    spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
-}
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
 
 class Horde_Injector_AllTests
 {
@@ -21,7 +20,11 @@ class Horde_Injector_AllTests
 
     public static function suite()
     {
+        if (!spl_autoload_functions()) {
+            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
+        }
         set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path());
+
         $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Injector');
 
         $basedir = dirname(__FILE__);
index 33d1f95..be00b37 100644 (file)
@@ -18,9 +18,8 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Log_AllTests::main');
 }
 
-if (!spl_autoload_functions()) {
-    spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
-}
+require_once 'PHPUnit/Framework.php';
+require_once 'PHPUnit/TextUI/TestRunner.php';
 
 /**
  * @category Horde
@@ -40,7 +39,11 @@ class Horde_Log_AllTests
 
     public static function suite()
     {
+        if (!spl_autoload_functions()) {
+            spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include_once "$filename.php";'));
+        }
         set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path());
+
         $suite = new PHPUnit_Framework_TestSuite('Horde_Log');
 
         $basedir = dirname(__FILE__);