more repeatable autoload setup for tests
authorChuck Hagenbuch <chuck@horde.org>
Mon, 21 Sep 2009 04:11:37 +0000 (00:11 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Mon, 21 Sep 2009 04:11:37 +0000 (00:11 -0400)
framework/Injector/test/Horde/Injector/AllTests.php

index e0306e9..969ba93 100644 (file)
@@ -8,7 +8,9 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Injector_AllTests::main');
 }
 
-require 'Horde/Autoloader.php';
+if (!spl_autoload_functions()) {
+    spl_autoload_register(create_function('$class', '$filename = str_replace(array(\'::\', \'_\'), \'/\', $class); @include "$filename.php";'));
+}
 
 class Horde_Injector_AllTests {
 
@@ -19,6 +21,7 @@ class Horde_Injector_AllTests {
 
     public static function suite()
     {
+        set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path());
         $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Injector');
 
         $basedir = dirname(__FILE__);