From: Chuck Hagenbuch Date: Tue, 3 Feb 2009 22:33:29 +0000 (-0500) Subject: start adding repeater tests independent of horde_date_parser X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9d10ca19e6f58cca46153419dd0f40a516d6d334;p=horde.git start adding repeater tests independent of horde_date_parser --- diff --git a/framework/Date_Parser/test/Horde/Date/AllTests.php b/framework/Date_Parser/test/Horde/Date/AllTests.php new file mode 100644 index 000000000..c68efa643 --- /dev/null +++ b/framework/Date_Parser/test/Horde/Date/AllTests.php @@ -0,0 +1,54 @@ +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; + } + +} + +if (PHPUnit_MAIN_METHOD == 'Horde_Date_AllTests::main') { + Horde_Date_AllTests::main(); +} diff --git a/framework/Date_Parser/test/Horde/Date/Parser/AllTests.php b/framework/Date_Parser/test/Horde/Date/Parser/AllTests.php index 051cff594..a4d9c8a98 100644 --- a/framework/Date_Parser/test/Horde/Date/Parser/AllTests.php +++ b/framework/Date_Parser/test/Horde/Date/Parser/AllTests.php @@ -23,7 +23,7 @@ class Horde_Date_Parser_AllTests { public static function suite() { - set_include_path(dirname(__FILE__) . '/../../../lib' . PATH_SEPARATOR . get_include_path()); + 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";')); } diff --git a/framework/Date_Parser/test/Horde/Date/Repeater/DayTest.php b/framework/Date_Parser/test/Horde/Date/Repeater/DayTest.php new file mode 100644 index 000000000..99dfd37e2 --- /dev/null +++ b/framework/Date_Parser/test/Horde/Date/Repeater/DayTest.php @@ -0,0 +1,22 @@ +now = new Horde_Date('2009-01-01'); + $this->assertEquals('(2009-01-02 00:00:00..2009-01-03 00:00:00)', (string)$repeater->next('future')); + } + +}