From 0c09d085856f952b2b00e7c3aa10e9add23ae6e0 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 12 Feb 2011 22:32:16 -0500 Subject: [PATCH] Removing duplicate methods. --- cake/tests/lib/cake_test_suite_command.php | 2 +- cake/tests/lib/cake_test_suite_dispatcher.php | 26 ++----------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/cake/tests/lib/cake_test_suite_command.php b/cake/tests/lib/cake_test_suite_command.php index 0d9d62200..d7c5fa835 100644 --- a/cake/tests/lib/cake_test_suite_command.php +++ b/cake/tests/lib/cake_test_suite_command.php @@ -161,6 +161,6 @@ class CakeTestSuiteCommand extends PHPUnit_TextUI_Command { } elseif (include_once $appFile) { $object = new $appClass(null, $this->_params); } - $this->arguments['printer'] = $object; + return $this->arguments['printer'] = $object; } } \ No newline at end of file diff --git a/cake/tests/lib/cake_test_suite_dispatcher.php b/cake/tests/lib/cake_test_suite_dispatcher.php index e78d43001..57ab21c94 100644 --- a/cake/tests/lib/cake_test_suite_dispatcher.php +++ b/cake/tests/lib/cake_test_suite_dispatcher.php @@ -172,36 +172,14 @@ class CakeTestSuiteDispatcher { * @return void */ function _testCaseList() { - $Reporter =& $this->getReporter(); + $command = new CakeTestSuiteCommand('', $this->params); + $Reporter = $command->handleReporter($this->params['output']); $Reporter->paintDocumentStart(); $Reporter->paintTestMenu(); $Reporter->testCaseList(); $Reporter->paintDocumentEnd(); } -/** - * Gets the reporter based on the request parameters - * - * @return void - * @static - */ - function &getReporter() { - if (!self::$_Reporter) { - $type = strtolower($this->params['output']); - $coreClass = 'Cake' . ucwords($this->params['output']) . 'Reporter'; - $coreFile = CAKE_TESTS_LIB . 'reporter/cake_' . $type . '_reporter.php'; - - $appClass = $this->params['output'] . 'Reporter'; - $appFile = APPLIBS . 'test_suite/reporter/' . $type . '_reporter.php'; - if (include_once $coreFile) { - self::$_Reporter = new $coreClass(null, $this->params); - } elseif (include_once $appFile) { - self::$_Reporter = new $appClass(null, $this->params); - } - } - return self::$_Reporter; - } - /** * Sets the params, calling this will bypass the auto parameter parsing. *