From b10683474ef367f9d4d4cf1400e1c9221a7663d0 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Tue, 12 Oct 2010 18:36:38 +0200 Subject: [PATCH] Use Horde_Test. --- framework/Support/test/Horde/Support/AllTests.php | 60 +++++++---------------- 1 file changed, 19 insertions(+), 41 deletions(-) diff --git a/framework/Support/test/Horde/Support/AllTests.php b/framework/Support/test/Horde/Support/AllTests.php index 31fe77efe..a147e8052 100644 --- a/framework/Support/test/Horde/Support/AllTests.php +++ b/framework/Support/test/Horde/Support/AllTests.php @@ -1,58 +1,36 @@ + * @license http://opensource.org/licenses/bsd-license.php * @category Horde * @package Support * @subpackage UnitTests - * @copyright 2008-2009 The Horde Project (http://www.horde.org/) - * @license http://opensource.org/licenses/bsd-license.php */ +/** + * Define the main method + */ if (!defined('PHPUnit_MAIN_METHOD')) { define('PHPUnit_MAIN_METHOD', 'Horde_Support_AllTests::main'); } -require_once 'PHPUnit/Framework.php'; -require_once 'PHPUnit/TextUI/TestRunner.php'; - -class Horde_Support_AllTests { - - public static function main() - { - PHPUnit_TextUI_TestRunner::run(self::suite()); - } - - public static function suite() - { - // Catch strict standards - error_reporting(E_ALL | E_STRICT); - - // Set up autoload - 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 Framework - Horde_Support'); - - $basedir = dirname(__FILE__); - $baseregexp = preg_quote($basedir . DIRECTORY_SEPARATOR, '/'); - - foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) { - if ($file->isFile() && preg_match('/Test.php$/', $file->getFilename())) { - $pathname = $file->getPathname(); - require $pathname; - - $class = str_replace(DIRECTORY_SEPARATOR, '_', - preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname)); - $suite->addTestSuite('Horde_Support_' . $class); - } - } - - return $suite; - } +/** + * Prepare the test setup. + */ +require_once 'Horde/Test/AllTests.php'; +/** + * @package Horde_Support + * @subpackage UnitTests + */ +class Horde_Support_AllTests extends Horde_Test_AllTests +{ } +Horde_Support_AllTests::init('Horde_Support', __FILE__); + if (PHPUnit_MAIN_METHOD == 'Horde_Support_AllTests::main') { Horde_Support_AllTests::main(); } -- 2.11.0