From: Chuck Hagenbuch Date: Mon, 21 Sep 2009 04:11:37 +0000 (-0400) Subject: more repeatable autoload setup for tests X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=cbf67ca1ec9ef3413e84ddc13de0685303e55a92;p=horde.git more repeatable autoload setup for tests --- diff --git a/framework/Injector/test/Horde/Injector/AllTests.php b/framework/Injector/test/Horde/Injector/AllTests.php index e0306e9b0..969ba93b1 100644 --- a/framework/Injector/test/Horde/Injector/AllTests.php +++ b/framework/Injector/test/Horde/Injector/AllTests.php @@ -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__);