1: <?php
2: 3: 4: 5: 6: 7: 8: 9:
10:
11: 12: 13:
14: if (!defined('PHPUnit_MAIN_METHOD')) {
15: define('PHPUnit_MAIN_METHOD', 'Ingo_AllTests::main');
16: }
17:
18: 19: 20:
21: @define('INGO_BASE', dirname(__FILE__) . '/../..');
22: require_once 'Horde/Autoloader/Default.php';
23: date_default_timezone_set('Europe/Berlin');
24:
25: 26: 27: 28:
29: class Ingo_AllTests extends Horde_Test_AllTests
30: {
31: 32: 33: 34: 35:
36: public static function suite()
37: {
38:
39: error_reporting(E_ALL);
40:
41:
42: $basedir = dirname(__FILE__);
43: $GLOBALS['__autoloader']->addClassPathMapper(new Horde_Autoloader_ClassPathMapper_Prefix('/^Ingo(?:$|_)/', $basedir . '/../'));
44:
45: $suite = new PHPUnit_Framework_TestSuite('Ingo');
46: $baseregexp = preg_quote($basedir . DIRECTORY_SEPARATOR, '/');
47:
48: foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basedir)) as $file) {
49: if ($file->isFile() && preg_match('/Test.php$/', $file->getFilename())) {
50: $pathname = $file->getPathname();
51: require $pathname;
52:
53: $class = str_replace(DIRECTORY_SEPARATOR, '_',
54: preg_replace("/^$baseregexp(.*)\.php/", '\\1', $pathname));
55: $suite->addTestSuite('Ingo_' . $class);
56: }
57: }
58:
59: return $suite;
60: }
61: }
62:
63: if (PHPUnit_MAIN_METHOD == 'Ingo_AllTests::main') {
64: Ingo_AllTests::main('Ingo', __FILE__);
65: }
66: