diff --git a/tests/AllTests.php b/tests/AllTests.php new file mode 100644 index 0000000000..0cbf7cc8be --- /dev/null +++ b/tests/AllTests.php @@ -0,0 +1,42 @@ +. + +/** + * @package Tests + * @subpackage UnitTests + * @copyright Copyright (C) 2002 - 2009 Mantis Team - mantisbt-dev@lists.sourceforge.net + * @link http://www.mantisbt.org + */ + +/** + * Test Configuration + */ +require_once 'TestConfig.php'; + +require_once 'Mantis/AllTests.php'; + +class AllTests +{ + + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite('Mantis Bug Tracker'); + + $suite->addTest(Mantis_AllTests::suite()); + + return $suite; + } +} diff --git a/tests/Mantis/AllTests.php b/tests/Mantis/AllTests.php new file mode 100644 index 0000000000..e22c5857f6 --- /dev/null +++ b/tests/Mantis/AllTests.php @@ -0,0 +1,47 @@ +. + +/** + * @package Tests + * @subpackage UnitTests + * @copyright Copyright (C) 2002 - 2009 Mantis Team - mantisbt-dev@lists.sourceforge.net + * @link http://www.mantisbt.org + */ + +/** + * Test config + */ +require_once dirname(__FILE__) . '/../TestConfig.php'; + +require_once 'EnumTest.php'; + +/** + * @package Tests + * @subpackage UnitTests + * @copyright Copyright (C) 2002 - 2009 Mantis Team - mantisbt-dev@lists.sourceforge.net + * @link http://www.mantisbt.org + */ +class Mantis_AllTests +{ + public static function suite() + { + $suite = new PHPUnit_Framework_TestSuite('Mantis Bug Tracker'); + + $suite->addTestSuite('MantisEnumTest'); + + return $suite; + } +} diff --git a/tests/MantisEnumTest.php b/tests/MantisEnumTest.php index 911f9c279d..0f5bc1b790 100644 --- a/tests/MantisEnumTest.php +++ b/tests/MantisEnumTest.php @@ -24,8 +24,7 @@ require_once 'PHPUnit/Framework.php'; -$t_root_path = dirname( dirname( __FILE__ ) ) . DIRECTORY_SEPARATOR; -require_once $t_root_path . 'core/classes/MantisEnum.class.php'; +require_once 'MantisEnum.class.php'; /** * Test cases for MantisEnum class. diff --git a/tests/TestConfig.php b/tests/TestConfig.php new file mode 100644 index 0000000000..965dbcfbae --- /dev/null +++ b/tests/TestConfig.php @@ -0,0 +1,63 @@ +. + +/** + * @package Tests + * @subpackage UnitTests + * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org + * @copyright Copyright (C) 2002 - 2009 Mantis Team - mantisbt-dev@lists.sourceforge.net + * @link http://www.mantisbt.org + */ + +/* + * Start output buffering + */ +ob_start(); + +/* + * Include PHPUnit dependencies + */ +require_once 'PHPUnit/Framework.php'; +/* + * Set error reporting to the level to which Zend Framework code must comply. + */ +error_reporting( E_ALL | E_STRICT ); + +/* + * Determine the root, library, and tests directories of the framework + * distribution. + */ +$mantisRoot = dirname(__FILE__) . '/..'; +$mantisLibrary = "$mantisRoot/core/classes"; +$mantisTests = "$mantisRoot/tests"; + + +/* + * Prepend the application/ and tests/ directories to the + * include_path. + */ +$path = array( + $mantisLibrary, + $mantisTests, + get_include_path() + ); +set_include_path( implode( PATH_SEPARATOR, $path ) ); + + +/* + * Unset global variables that are no longer needed. + */ +unset($mantisRoot, $mantisLibrary, $mantisTests, $path);