diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index 7523c6b45..1b671204d 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -46,7 +46,7 @@ class CakeTestSuiteDispatcher { * * @var string */ - var $_managerClass; + var $_managerClass = 'TestManager'; /** * The Instance of the Manager being used. @@ -162,12 +162,6 @@ class CakeTestSuiteDispatcher { * @static */ function &getManager() { - $className = ucwords($this->params['output']) . 'TestManager'; - if (class_exists($className)) { - $this->_managerClass = $className; - } else { - $this->_managerClass = 'TextTestManager'; - } if (empty($this->Manager)) { $this->Manager = new $this->_managerClass(); } diff --git a/cake/tests/lib/test_manager.php b/cake/tests/lib/test_manager.php index 7181f7465..09a3572cd 100644 --- a/cake/tests/lib/test_manager.php +++ b/cake/tests/lib/test_manager.php @@ -449,193 +449,4 @@ class CliTestManager extends TestManager { } } -/** - * The TextTestManager ensures that the list of available tests is printed as a list of urls in a text-friendly format - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class TextTestManager extends TestManager { - var $_url; - -/** - * Constructor - * - * @return void - * @access public - */ - function TextTestManager() { - parent::TestManager(); - $this->_url = $_SERVER['PHP_SELF']; - } - -/** - * Returns the base url - * - * @return string The base URL for link building. - * @access public - */ - function getBaseURL() { - return $this->_url; - } - -/** - * Returns a list of available group tests in a text-friendly format - * - * @return string A link list for group tests. - * @access public - */ - function &getGroupTestList() { - $manager =& new TextTestManager(); - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - - $buffer = "Core Test Groups:\n"; - $urlExtra = ''; - if ($manager->appTest) { - $buffer = "App Test Groups:\n"; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = Inflector::humanize($manager->pluginTest) . " Test Groups:\n"; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - $buffer .= "All tests\n" . $_SERVER['SERVER_NAME'] . $manager->getBaseURL() . "?group=all&output=txt{$urlExtra}\n"; - - foreach ((array)$groupTests as $groupTest) { - $buffer .= $_SERVER['SERVER_NAME'] . $manager->getBaseURL() . "?group=" . $groupTest . "&output=text{$urlExtra}\n"; - } - - return $buffer; - } - -/** - * Returns a list of available test cases in a text-friendly format - * - * @param string A link list for test cases. - * @access public - */ - function &getTestCaseList() { - $manager =& new TextTestManager(); - $testCases =& $manager->_getTestCaseList($manager->_getTestsPath()); - - $buffer = "Core Test Cases:\n"; - $urlExtra = ''; - if ($manager->appTest) { - $buffer = "App Test Cases:\n"; - $urlExtra = '&app=true'; - } else if ($manager->pluginTest) { - $buffer = Inflector::humanize($manager->pluginTest) . " Test Cases:\n"; - $urlExtra = '&plugin=' . $manager->pluginTest; - } - - if (1 > count($testCases)) { - $buffer .= "EMPTY"; - return $buffer; - } - - foreach ($testCases as $testCaseFile => $testCase) { - $buffer .= $_SERVER['SERVER_NAME']. $manager->getBaseURL()."?case=" . $testCase . "&output=text"."\n"; - } - - $buffer .= "\n"; - return $buffer; - } -} - -/** - * The HtmlTestManager provides the foundation for the web-based CakePHP testsuite. - * It prints the different lists of tests and provides the interface for CodeCoverage, etc. - * - * @package cake - * @subpackage cake.cake.tests.lib - */ -class HtmlTestManager extends TestManager { - var $_url; - -/** - * Constructor - * - * @return void - * @access public - */ - function HtmlTestManager() { - parent::TestManager(); - $this->_url = $_SERVER['PHP_SELF']; - } - -/** - * Returns the current base url - * - * @return void - * @access public - */ - function getBaseURL() { - return $this->_url; - } - -/** - * Prints the links to the available group tests - * - * @access public - */ - function &getGroupTestList() { - $manager =& new HtmlTestManager(); - $urlExtra = ''; - $groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups')); - - $buffer = "