One test suite to rule them all.
authorJan Schneider <jan@horde.org>
Thu, 3 Dec 2009 12:05:04 +0000 (13:05 +0100)
committerJan Schneider <jan@horde.org>
Thu, 3 Dec 2009 12:05:04 +0000 (13:05 +0100)
27 files changed:
framework/Argv/test/Horde/Argv/AllTests.php
framework/Auth/test/Horde/Auth/AllTests.php
framework/Constraint/test/Horde/Constraint/AllTests.php
framework/Controller/test/Horde/Controller/AllTests.php
framework/Date/test/Horde/Date/AllTests.php
framework/Db/test/Horde/Db/AllTests.php
framework/Feed/test/Horde/Feed/AllTests.php
framework/History/test/Horde/History/AllTests.php
framework/Http/test/Horde/Http/AllTests.php
framework/Injector/test/Horde/Injector/AllTests.php
framework/Kolab_Format/test/Horde/Kolab/Format/AllTests.php
framework/Kolab_FreeBusy/test/Horde/Kolab/FreeBusy/AllTests.php
framework/Kolab_Server/test/Horde/Kolab/Server/AllTests.php
framework/Kolab_Session/test/Horde/Kolab/Session/AllTests.php
framework/Kolab_Storage/test/Horde/Kolab/Storage/AllTests.php
framework/Log/test/Horde/Log/AllTests.php
framework/Mime/test/Horde/Mime/AllTests.php
framework/Notification/test/Horde/Notification/AllTests.php
framework/Pdf/test/Horde/Pdf/AllTests.php
framework/Routes/test/Horde/Routes/AllTests.php
framework/Stream_Filter/test/Horde/Stream/Filter/AllTests.php
framework/Support/test/Horde/Support/AllTests.php
framework/Test/package.xml
framework/Text_Textile/test/Horde/Text/Textile/AllTests.php
framework/View/test/Horde/View/AllTests.php
framework/Xml_Element/test/Horde/Xml/Element/AllTests.php
framework/Yaml/test/Horde/Yaml/AllTests.php

index a97d8f6..b1e2039 100644 (file)
  * @subpackage UnitTests
  */
 
-if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Horde_Argv_AllTests::main');
-}
-
 if (!function_exists('_')) {
     function _($t) {
         return $t;
     }
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
-
 /**
- * @package    Horde_Argv
- * @subpackage UnitTests
+ * Define the main method
  */
-class Horde_Argv_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";'));
-        }
-
-        // Test base classes and helper objects
-        require_once dirname(__FILE__) . '/TestCase.php';
-        require_once dirname(__FILE__) . '/ConflictTestCase.php';
-        require_once dirname(__FILE__) . '/InterceptedException.php';
-        require_once dirname(__FILE__) . '/InterceptingParser.php';
-
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Argv');
-
-        $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;
+if (!defined('PHPUnit_MAIN_METHOD')) {
+    define('PHPUnit_MAIN_METHOD', 'Horde_Url_AllTests::main');
+}
 
-                $class = str_replace(DIRECTORY_SEPARATOR, '_',
-                                     preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname));
-                $suite->addTestSuite('Horde_Argv_' . $class);
-            }
-        }
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
-        return $suite;
-    }
+/* Test base classes and helper objects */
+require_once dirname(__FILE__) . '/TestCase.php';
+require_once dirname(__FILE__) . '/ConflictTestCase.php';
+require_once dirname(__FILE__) . '/InterceptedException.php';
+require_once dirname(__FILE__) . '/InterceptingParser.php';
 
+/**
+ * @package    Horde_Url
+ * @subpackage UnitTests
+ */
+class Horde_Url_AllTests extends Horde_Test_AllTests
+{
 }
 
-if (PHPUnit_MAIN_METHOD == 'Horde_Argv_AllTests::main') {
-    Horde_Argv_AllTests::main();
+if (PHPUnit_MAIN_METHOD == 'Horde_Url_AllTests::main') {
+    Horde_Url_AllTests::main('Horde_Url', __FILE__);
 }
index 398a95a..a003df4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * All tests for the Horde_Auth:: package.
+ * All tests for the Horde_Auth package.
  *
  * PHP version 5
  *
@@ -19,64 +19,19 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Auth_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category   Horde
- * @package    Auth
+ * @package    Horde_Auth
  * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Auth
  */
-class Horde_Auth_AllTests
+class Horde_Auth_AllTests extends Horde_Test_AllTests
 {
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Auth');
-
-        $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_Auth_' . $class);
-            }
-        }
-
-        return $suite;
-    }
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Auth_AllTests::main') {
-    Horde_Auth_AllTests::main();
+    Horde_Auth_AllTests::main('Horde_Auth', __FILE__);
 }
index cef8231..3793577 100644 (file)
@@ -4,48 +4,26 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Horde_Constraint_AllTests::main');
+    define('PHPUnit_MAIN_METHOD', 'Horde_Horde_Constraint_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
-class Horde_Constraint_AllTests
+/**
+ * @package    Horde_Horde_Constraint
+ * @subpackage UnitTests
+ */
+class Horde_Horde_Constraint_AllTests extends Horde_Test_AllTests
 {
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Constraint');
-
-        $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_Constraint_' . $class);
-            }
-        }
-
-        return $suite;
-    }
 }
 
-if (PHPUnit_MAIN_METHOD == 'Horde_Constraint_AllTests::main') {
-    Horde_Constraint_AllTests::main();
+if (PHPUnit_MAIN_METHOD == 'Horde_Horde_Constraint_AllTests::main') {
+    Horde_Horde_Constraint_AllTests::main('Horde_Horde_Constraint', __FILE__);
 }
index 841f3c6..7f72409 100644 (file)
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Controller_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * @author     Mike Naberezny <mike@maintainable.com>
- * @author     Derek DeVries <derek@maintainable.com>
- * @author     Chuck Hagenbuch <chuck@horde.org>
- * @license    http://opensource.org/licenses/bsd-license.php
- * @category   Horde
  * @package    Horde_Controller
  * @subpackage UnitTests
  */
-class Horde_Controller_AllTests {
-
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Controller');
-
-        $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_Controller_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
+class Horde_Controller_AllTests extends Horde_Test_AllTests
+{
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Controller_AllTests::main') {
-    Horde_Controller_AllTests::main();
+    Horde_Controller_AllTests::main('Horde_Controller', __FILE__);
 }
index 4c884e9..01e0bc9 100644 (file)
@@ -1,55 +1,32 @@
 <?php
 /**
  * @category   Horde
- * @package    Date
+ * @package    Horde_Date
  * @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_Date_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
-
-class Horde_Date_AllTests {
-
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Date');
-
-        $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_Date_' . $class);
-            }
-        }
-
-        return $suite;
-    }
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
+/**
+ * @package    Horde_Date
+ * @subpackage UnitTests
+ */
+class Horde_Date_AllTests extends Horde_Test_AllTests
+{
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Date_AllTests::main') {
-    Horde_Date_AllTests::main();
+    Horde_Date_AllTests::main('Horde_Date', __FILE__);
 }
index d84cf29..00dbbd2 100644 (file)
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Horde_Db_AllTests::main');
+    define('PHPUnit_MAIN_METHOD', 'Horde_Url_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 require_once dirname(__FILE__) . '/Adapter/MissingTest.php';
 
+/* Ensure a default timezone is set. */
+date_default_timezone_set('America/New_York');
+
 /**
- * @author     Mike Naberezny <mike@maintainable.com>
- * @author     Derek DeVries <derek@maintainable.com>
- * @author     Chuck Hagenbuch <chuck@horde.org>
- * @license    http://opensource.org/licenses/bsd-license.php
- * @category   Horde
- * @package    Horde_Db
+ * @package    Horde_Url
  * @subpackage UnitTests
  */
-class Horde_Db_AllTests {
-
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // Catch strict standards
-        error_reporting(E_ALL | E_STRICT);
-
-        // Ensure a default timezone is set.
-        date_default_timezone_set('America/New_York');
-
-        // 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";'));
-        }
-
-        // Build the suite
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Db');
-
-        $basedir = dirname(__FILE__);
-        $baseregexp = preg_quote($basedir . DIRECTORY_SEPARATOR, '/');
-
-        // Handle the Adapter tests
-        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir . '/Adapter')) as $file) {
-            if ($file->isFile() && preg_match('/Suite.php$/', $file->getFilename())) {
-                $pathname = $file->getPathname();
-                require $pathname;
-
-                $class = str_replace(DIRECTORY_SEPARATOR, '_',
-                                     preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname));
-                $suite->addTestSuite('Horde_Db_' . $class);
-            }
-        }
-
-        // Add other tests
-        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
-            if ($file->isFile() && !preg_match("/^{$baseregexp}Adapter/", $file->getPathname()) && 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_Db_' . $class);
-            }
-        }
-
-
-        return $suite;
-    }
-
+class Horde_Url_AllTests extends Horde_Test_AllTests
+{
 }
 
-if (PHPUnit_MAIN_METHOD == 'Horde_Db_AllTests::main') {
-    Horde_Db_AllTests::main();
+if (PHPUnit_MAIN_METHOD == 'Horde_Url_AllTests::main') {
+    Horde_Url_AllTests::main('Horde_Url', __FILE__);
 }
index 0c4fc14..3e85d67 100644 (file)
@@ -4,49 +4,26 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Feed_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
-class Horde_Feed_AllTests
+/**
+ * @package    Horde_Feed
+ * @subpackage UnitTests
+ */
+class Horde_Feed_AllTests extends Horde_Test_AllTests
 {
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Feed');
-
-        $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_Feed_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Feed_AllTests::main') {
-    Horde_Feed_AllTests::main();
+    Horde_Feed_AllTests::main('Horde_Feed', __FILE__);
 }
index 7f7654e..a2cdc94 100644 (file)
@@ -19,68 +19,18 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
 }
 
 /**
- * The Autoloader allows us to omit "require/include" statements.
+ * Prepare the test setup.
  */
-require_once 'Horde/Autoloader.php';
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category Horde
- * @package  History
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=History
+ * @package    Horde_History
+ * @subpackage UnitTests
  */
-class Horde_History_AllTests
+class Horde_History_AllTests extends Horde_Test_AllTests
 {
-
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        // Catch strict standards
-        error_reporting(E_ALL | E_STRICT);
-
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - History');
-
-        $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_History_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_History_AllTests::main') {
-    Horde_History_AllTests::main();
+    Horde_History_AllTests::main('Horde_History', __FILE__);
 }
index fa9e6b5..3593eda 100644 (file)
@@ -7,49 +7,26 @@
  * @license    http://opensource.org/licenses/bsd-license.php
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Http_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
-class Horde_Http_AllTests
+/**
+ * @package    Horde_Http
+ * @subpackage UnitTests
+ */
+class Horde_Http_AllTests extends Horde_Test_AllTests
 {
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Http');
-
-        $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_Http_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Http_AllTests::main') {
-    Horde_Http_AllTests::main();
+    Horde_Http_AllTests::main('Horde_Http', __FILE__);
 }
index fa64bf2..cc2e838 100644 (file)
@@ -4,48 +4,26 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Injector_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
-class Horde_Injector_AllTests
+/**
+ * @package    Horde_Injector
+ * @subpackage UnitTests
+ */
+class Horde_Injector_AllTests extends Horde_Test_AllTests
 {
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Injector');
-
-        $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_Injector_' . $class);
-            }
-        }
-
-        return $suite;
-    }
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Injector_AllTests::main') {
-    Horde_Injector_AllTests::main();
+    Horde_Injector_AllTests::main('Horde_Injector', __FILE__);
 }
index 9c9a16c..ab10ab1 100644 (file)
@@ -19,72 +19,18 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
 }
 
 /**
- * The Autoloader allows us to omit "require/include" statements.
+ * Prepare the test setup.
  */
-require_once 'Horde/Autoloader.php';
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category Kolab
- * @package  Kolab_Format
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Format
+ * @package    Horde_Kolab_Format
+ * @subpackage UnitTests
  */
-class Horde_Kolab_Format_AllTests
+class Horde_Kolab_Format_AllTests extends Horde_Test_AllTests
 {
-
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        // Catch strict standards
-        // FIXME: This does not work yet, as we still have a number of
-        //        static methods in basic Horde libraries that are not
-        //        declared as such. There are also strict failures for the
-        //        Horde_Date classes.
-        //error_reporting(E_ALL | E_STRICT);
-
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Kolab_Format');
-
-        $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_Kolab_Format_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Kolab_Format_AllTests::main') {
-    Horde_Kolab_Format_AllTests::main();
+    Horde_Kolab_Format_AllTests::main('Horde_Kolab_Format', __FILE__);
 }
index 798125b..c158bd1 100644 (file)
  */
 
 /**
- * Define the main method 
+ * Define the main method
  */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Kolab_FreeBusy_AllTests::main');
 }
 
 /**
- * The Autoloader allows us to omit "require/include" statements.
+ * Prepare the test setup.
  */
-require_once 'Horde/Autoloader.php';
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category   Kolab
- * @package    Kolab_FreeBusy
+ * @package    Horde_Kolab_FreeBusy
  * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Kolab_FreeBusy
  */
-class Horde_Kolab_FreeBusy_AllTests
+class Horde_Kolab_FreeBusy_AllTests extends Horde_Test_AllTests
 {
-
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        // Catch strict standards
-        // FIXME: This does not work yet, as we still have a number of
-        //        static methods in basic Horde libraries that are not
-        //        declared as such.
-        //error_reporting(E_ALL | E_STRICT);
-
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Kolab_FreeBusy');
-
-        $basedir    = dirname(__FILE__);
-        $baseregexp = preg_quote($basedir . DIRECTORY_SEPARATOR, '/');
-
-        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
-            //@TODO: Fix testing. Working on it...
-            continue;
-            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_Kolab_FreeBusy_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Kolab_FreeBusy_AllTests::main') {
-    Horde_Kolab_FreeBusy_AllTests::main();
+    Horde_Kolab_FreeBusy_AllTests::main('Horde_Kolab_FreeBusy', __FILE__);
 }
index 02ca677..bdde2d1 100644 (file)
@@ -21,63 +21,16 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
 /**
  * Prepare the test setup.
  */
-require_once dirname(__FILE__) . '/Autoload.php';
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category Kolab
- * @package  Kolab_Server
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Server
+ * @package    Horde_Kolab_Server
+ * @subpackage UnitTests
  */
-class Horde_Kolab_Server_AllTests
+class Horde_Kolab_Server_AllTests extends Horde_Test_AllTests
 {
-
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Kolab_Server');
-
-        $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_Kolab_Server_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Kolab_Server_AllTests::main') {
-    Horde_Kolab_Server_AllTests::main();
+    Horde_Kolab_Server_AllTests::main('Horde_Kolab_Server', __FILE__);
 }
index 84267a5..4eb2c9c 100644 (file)
@@ -21,65 +21,16 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
 /**
  * Prepare the test setup.
  */
-require_once dirname(__FILE__) . '/Autoload.php';
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category Kolab
- * @package  Kolab_Session
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Kolab_Session
+ * @package    Horde_Kolab_Session
+ * @subpackage UnitTests
  */
-class Horde_Kolab_Session_AllTests
+class Horde_Kolab_Session_AllTests extends Horde_Test_AllTests
 {
-
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Kolab_Session');
-
-        $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_Kolab_Session_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Kolab_Session_AllTests::main') {
-    Horde_Kolab_Session_AllTests::main();
+    Horde_Kolab_Session_AllTests::main('Horde_Kolab_Session', __FILE__);
 }
index f9990c9..fd1a12c 100644 (file)
  */
 
 /**
- * Define the main method 
+ * Define the main method
  */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Kolab_Storage_AllTests::main');
 }
 
 /**
- * The Autoloader allows us to omit "require/include" statements.
+ * Prepare the test setup.
  */
-require_once 'Horde/Autoloader.php';
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category   Kolab
- * @package    Kolab_Storage
+ * @package    Horde_Kolab_Storage
  * @subpackage UnitTests
- * @author     Gunnar Wrobel <wrobel@pardus.de>
- * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link       http://pear.horde.org/index.php?package=Kolab_Storage
  */
-class Horde_Kolab_Storage_AllTests
+class Horde_Kolab_Storage_AllTests extends Horde_Test_AllTests
 {
-
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        // Catch strict standards
-        // FIXME: This does not work yet, as we still have a number of
-        //        static methods in basic Horde libraries that are not
-        //        declared as such.
-        //error_reporting(E_ALL | E_STRICT);
-
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Kolab_Storage');
-
-        $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_Kolab_Storage_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Kolab_Storage_AllTests::main') {
-    Horde_Kolab_Storage_AllTests::main();
+    Horde_Kolab_Storage_AllTests::main('Horde_Kolab_Storage', __FILE__);
 }
index 0abfe3f..7615f60 100644 (file)
  * @license  http://opensource.org/licenses/bsd-license.php BSD
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Log_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * @category Horde
- * @package  Horde_Log
+ * @package    Horde_Log
  * @subpackage UnitTests
- * @author   Mike Naberezny <mike@maintainable.com>
- * @author   Chuck Hagenbuch <chuck@horde.org>
- * @license  http://opensource.org/licenses/bsd-license.php BSD
  */
-class Horde_Log_AllTests
+class Horde_Log_AllTests extends Horde_Test_AllTests
 {
-
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Log');
-
-        $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 = 'Horde_Log_' . str_replace(DIRECTORY_SEPARATOR, '_',
-                                                    preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname));
-                $suite->addTestSuite($class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Log_AllTests::main') {
-    Horde_Log_AllTests::main();
+    Horde_Log_AllTests::main('Horde_Log', __FILE__);
 }
index e69de29..b42aea1 100644 (file)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Horde_Mime test suite
+ *
+ * @author     Jan Schneider <jan@horde.org>
+ * @license    http://www.fsf.org/copyleft/lgpl.html LGPL
+ * @category   Horde
+ * @package    Horde_Mime
+ * @subpackage UnitTests
+ */
+
+/**
+ * Define the main method
+ */
+if (!defined('PHPUnit_MAIN_METHOD')) {
+    define('PHPUnit_MAIN_METHOD', 'Horde_Mime_AllTests::main');
+}
+
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
+
+/**
+ * @package    Horde_Mime
+ * @subpackage UnitTests
+ */
+class Horde_Mime_AllTests extends Horde_Test_AllTests
+{
+}
+
+if (PHPUnit_MAIN_METHOD == 'Horde_Mime_AllTests::main') {
+    Horde_Mime_AllTests::main('Horde_Mime', __FILE__);
+}
index 3aaf09b..e7045cf 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * All tests for the Horde_Kolab_Session:: package.
+ * All tests for the Horde_Notification package.
  *
  * PHP version 5
  *
  * Define the main method
  */
 if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Horde_Kolab_Session_AllTests::main');
+    define('PHPUnit_MAIN_METHOD', 'Horde_Notification_AllTests::main');
 }
 
 /**
  * Prepare the test setup.
  */
-require_once dirname(__FILE__) . '/Autoload.php';
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Combine the tests for this package.
- *
- * Copyright 2007-2009 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (LGPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
- *
- * @category Horde
- * @package  Notification
- * @author   Gunnar Wrobel <wrobel@pardus.de>
- * @license  http://www.fsf.org/copyleft/lgpl.html LGPL
- * @link     http://pear.horde.org/index.php?package=Notification
+ * @package    Horde_Notification
+ * @subpackage UnitTests
  */
-class Horde_Notification_AllTests
+class Horde_Notification_AllTests extends Horde_Test_AllTests
 {
-
-    /**
-     * Main entry point for running the suite.
-     *
-     * @return NULL
-     */
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    /**
-     * Collect the unit tests of this directory into a new suite.
-     *
-     * @return PHPUnit_Framework_TestSuite The test suite.
-     */
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Notification');
-
-        $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_Notification_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Notification_AllTests::main') {
-    Horde_Notification_AllTests::main();
+    Horde_Notification_AllTests::main('Horde_Notification', __FILE__);
 }
index 176051d..30c183e 100644 (file)
@@ -8,56 +8,26 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Horde::Pdf::AllTests::main');
+    define('PHPUnit_MAIN_METHOD', 'Horde_Pdf_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * Horde_Pdf test suite
- *
- * @category   Horde
  * @package    Horde_Pdf
  * @subpackage UnitTests
  */
-class Horde_Pdf_AllTests
+class Horde_Pdf_AllTests extends Horde_Test_AllTests
 {
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // 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_Pdf');
-
-        $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 = 'Horde_Pdf_' . str_replace(DIRECTORY_SEPARATOR, '_',
-                                                    preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname));
-                $suite->addTestSuite($class);
-            }
-        }
-
-        return $suite;
-    }
-
 }
 
-if (PHPUnit_MAIN_METHOD == 'Horde::Pdf::AllTests::main') {
-    Horde_Pdf_AllTests::main();
+if (PHPUnit_MAIN_METHOD == 'Horde_Pdf_AllTests::main') {
+    Horde_Pdf_AllTests::main('Horde_Pdf', __FILE__);
 }
index 9e1a24f..d70e494 100644 (file)
  * @package Horde_Routes
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Routes_AllTests::main');
 }
 
-error_reporting(E_ALL | E_STRICT);
-
-$lib = dirname(dirname(dirname(dirname(__FILE__)))) . '/lib/Horde/Routes/';
-require_once "$lib/Utils.php";
-require_once "$lib/Mapper.php";
-require_once "$lib/Route.php";
-require_once "$lib/Exception.php";
-
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * @package Horde_Routes
+ * @package    Horde_Routes
+ * @subpackage UnitTests
  */
-class Horde_Routes_AllTests
+class Horde_Routes_AllTests extends Horde_Test_AllTests
 {
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Routes');
-
-        $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($class);
-            }
-        }
-
-        return $suite;
-    }
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Routes_AllTests::main') {
-    Horde_Routes_AllTests::main();
+    Horde_Routes_AllTests::main('Horde_Routes', __FILE__);
 }
index 4377489..d72924f 100644 (file)
@@ -7,55 +7,26 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Stream_Filter_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
 /**
  * @package    Horde_Stream_Filter
  * @subpackage UnitTests
  */
-class Horde_Stream_Filter_AllTests
+class Horde_Stream_Filter_AllTests extends Horde_Test_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_Stream_Filter');
-
-        $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_Stream_Filter_' . $class);
-            }
-        }
-
-        return $suite;
-    }
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Stream_Filter_AllTests::main') {
-    Horde_Stream_Filter_AllTests::main();
+    Horde_Stream_Filter_AllTests::main('Horde_Stream_Filter', __FILE__);
 }
index a07e87e..31fe77e 100644 (file)
@@ -23,6 +23,9 @@ class Horde_Support_AllTests {
 
     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()) {
index f4c73f3..99b1a46 100644 (file)
@@ -30,6 +30,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
    <dir name="lib">
     <dir name="Horde">
      <dir name="Test">
+      <file name="AllTests.php" role="php" />
       <file name="Case.php" role="php" />
       <file name="Functional.php" role="php" />
      </dir> <!-- /lib/Horde/Test -->
@@ -53,6 +54,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
  </dependencies>
  <phprelease>
   <filelist>
+   <install name="lib/Horde/Test/AllTests.php" as="Horde/Test/AllTests.php" />
    <install name="lib/Horde/Test/Case.php" as="Horde/Test/Case.php" />
    <install name="lib/Horde/Test/Functional.php" as="Horde/Test/Functional.php" />
   </filelist>
index 4c06a52..b9ea31c 100755 (executable)
@@ -5,48 +5,26 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Text_Textile_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
 /**
- * @category   Horde
  * @package    Horde_Text_Textile
  * @subpackage UnitTests
  */
-class Horde_Text_Textile_AllTests {
-
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Text_Textile');
-
-        $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_Text_Textile_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
+class Horde_Text_Textile_AllTests extends Horde_Test_AllTests
+{
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Text_Textile_AllTests::main') {
-    Horde_Text_Textile_AllTests::main();
+    Horde_Text_Textile_AllTests::main('Horde_Text_Textile', __FILE__);
 }
index fba118a..f0146b2 100644 (file)
@@ -8,56 +8,29 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_View_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
-
-class Horde_View_AllTests {
-
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        // Catch strict standards
-        error_reporting(E_ALL | E_STRICT);
-
-        // Ensure a default timezone is set.
-        date_default_timezone_set('America/New_York');
-
-        // 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";'));
-        }
-
-        // Build the suite
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_View');
-
-        $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_View_' . $class);
-            }
-        }
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
 
-        return $suite;
-    }
+/* Ensure a default timezone is set. */
+date_default_timezone_set('America/New_York');
 
+/**
+ * @package    Horde_View
+ * @subpackage UnitTests
+ */
+class Horde_View_AllTests extends Horde_Test_AllTests
+{
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_View_AllTests::main') {
-    Horde_View_AllTests::main();
+    Horde_View_AllTests::main('Horde_View', __FILE__);
 }
index 530ad52..7c5946c 100644 (file)
@@ -11,39 +11,16 @@ if (!defined('PHPUnit_MAIN_METHOD')) {
     define('PHPUnit_MAIN_METHOD', 'Horde_Xml_Element_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
-
-class Horde_Xml_Element_AllTests {
-
-    public static function main()
-    {
-        PHPUnit_TextUI_TestRunner::run(self::suite());
-    }
-
-    public static function suite()
-    {
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Xml_Element');
-
-        $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_Xml_Element_' . $class);
-            }
-        }
-
-        return $suite;
-    }
+require_once 'Horde/Test/AllTests.php';
 
+/**
+ * @package    Horde_Url
+ * @subpackage UnitTests
+ */
+class Horde_Xml_Element_AllTests extends Horde_Test_AllTests
+{
 }
 
 if (PHPUnit_MAIN_METHOD == 'Horde_Xml_Element_AllTests::main') {
-    Horde_Xml_Element_AllTests::main();
+    Horde_Xml_Element_AllTests::main('Horde_Xml_Element', __FILE__);
 }
index 021dca4..4525a46 100644 (file)
@@ -9,60 +9,27 @@
  * @subpackage UnitTests
  */
 
+/**
+ * Define the main method
+ */
 if (!defined('PHPUnit_MAIN_METHOD')) {
-    define('PHPUnit_MAIN_METHOD', 'Horde_Yaml_AllTests::main');
+    define('PHPUnit_MAIN_METHOD', 'Horde_Url_AllTests::main');
 }
 
-require_once 'PHPUnit/Framework.php';
-require_once 'PHPUnit/TextUI/TestRunner.php';
+/**
+ * Prepare the test setup.
+ */
+require_once 'Horde/Test/AllTests.php';
+require_once dirname(__FILE__) . '/Helpers.php';
 
 /**
- * @category   Horde
- * @package    Horde_Yaml
+ * @package    Horde_Url
  * @subpackage UnitTests
  */
-class Horde_Yaml_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";'));
-        }
-
-        // Test helpers
-        require_once dirname(__FILE__) . '/Helpers.php';
-
-        $suite = new PHPUnit_Framework_TestSuite('Horde Framework - Horde_Yaml');
-
-        $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_Yaml_' . $class);
-            }
-        }
-
-        return $suite;
-    }
-
+class Horde_Url_AllTests extends Horde_Test_AllTests
+{
 }
 
-if (PHPUnit_MAIN_METHOD == 'Horde_Yaml_AllTests::main') {
-    Horde_Yaml_AllTests::main();
+if (PHPUnit_MAIN_METHOD == 'Horde_Url_AllTests::main') {
+    Horde_Url_AllTests::main('Horde_Url', __FILE__);
 }