Permalink
Browse files

Converting static calls to TestManager to use Manager instance in the…

… TestSuiteDispatcher.

Converting static methods to instance methods.
  • Loading branch information...
1 parent e60d742 commit 104086b928dffee7e8a18e4388378de4f36444d7 @markstory markstory committed Jan 5, 2010
Showing with 7 additions and 10 deletions.
  1. +3 −3 cake/tests/lib/cake_test_suite_dispatcher.php
  2. +4 −7 cake/tests/lib/test_manager.php
@@ -180,12 +180,12 @@ function _parseParams() {
function _runGroupTest() {
$Reporter =& CakeTestSuiteDispatcher::getReporter();
if ('all' == $this->params['group']) {
- TestManager::runAllTests($Reporter);
+ $this->Manager->runAllTests($Reporter);
} else {
if ($this->params['codeCoverage']) {
CodeCoverageManager::start($this->params['group'], $Reporter);
}
- TestManager::runGroupTest(ucfirst($this->params['group']), $Reporter);
+ $this->Manager->runGroupTest(ucfirst($this->params['group']), $Reporter);
if ($this->params['codeCoverage']) {
CodeCoverageManager::report();
}
@@ -205,7 +205,7 @@ function _runTestCase() {
CodeCoverageManager::start($_GET['case'], $Reporter);
}
- TestManager::runTestCase($_GET['case'], $Reporter);
+ $this->Manager->runTestCase($_GET['case'], $Reporter);
if ($this->params['codeCoverage']) {
CodeCoverageManager::report();
@@ -131,9 +131,7 @@ function runAllTests(&$reporter, $testing = false) {
* @access public
*/
function runTestCase($testCaseFile, &$reporter, $testing = false) {
- $manager =& new TestManager();
-
- $testCaseFileWithPath = $manager->_getTestsPath() . DS . $testCaseFile;
+ $testCaseFileWithPath = $this->_getTestsPath() . DS . $testCaseFile;
if (!file_exists($testCaseFileWithPath)) {
trigger_error("Test case {$testCaseFile} cannot be found", E_USER_ERROR);
@@ -158,16 +156,15 @@ function runTestCase($testCaseFile, &$reporter, $testing = false) {
* @access public
*/
function runGroupTest($groupTestName, &$reporter) {
- $manager =& new TestManager();
- $filePath = $manager->_getTestsPath('groups') . DS . strtolower($groupTestName) . $manager->_groupExtension;
+ $filePath = $this->_getTestsPath('groups') . DS . strtolower($groupTestName) . $this->_groupExtension;
if (!file_exists($filePath)) {
trigger_error("Group test {$groupTestName} cannot be found at {$filePath}", E_USER_ERROR);
}
require_once $filePath;
$test =& new TestSuite($groupTestName . ' group test');
- foreach ($manager->_getGroupTestClassNames($filePath) as $groupTest) {
+ foreach ($this->_getGroupTestClassNames($filePath) as $groupTest) {
$testCase = new $groupTest();
$test->addTestCase($testCase);
if (isset($testCase->label)) {
@@ -582,8 +579,8 @@ function getBaseURL() {
* @access public
*/
function &getGroupTestList() {
- $urlExtra = '';
$manager =& new HtmlTestManager();
+ $urlExtra = '';
$groupTests =& $manager->_getTestGroupList($manager->_getTestsPath('groups'));
$buffer = "<h3>Core Test Groups:</h3>\n<ul>";

0 comments on commit 104086b

Please sign in to comment.