/** * Retrieves a list of test cases from the active Manager class, * displaying it in the correct format for the reporter subclass * * @return mixed */ public function testCaseList() { $testList = TestManager::getTestCaseList($this->params); return $testList; }
/** * Retrieves a list of test cases from the active Manager class, * displaying it in the correct format for the reporter subclass * * @return mixed */ function testCaseList() { $testList = TestManager::getTestCaseList(); return $testList; }
/** * Shows a list of available test cases and gives the option to run one of them * * @return void */ public function available() { $params = $this->parseArgs(); $testCases = TestManager::getTestCaseList($params); $app = $params['app']; $plugin = $params['plugin']; $title = "Core Test Cases:"; $category = 'core'; if ($app) { $title = "App Test Cases:"; $category = 'app'; } elseif ($plugin) { $title = Inflector::humanize($plugin) . " Test Cases:"; $category = $plugin; } if (empty($testCases)) { $this->out(__("No test cases available \n\n")); return $this->out($this->OptionParser->help()); } $this->out($title); $i = 1; $cases = array(); foreach ($testCases as $testCaseFile => $testCase) { $case = explode(DS, str_replace('.test.php', '', $testCase)); $case[count($case) - 1] = Inflector::camelize($case[count($case) - 1]); $case = implode('/', $case); $this->out("[{$i}] {$case}"); $cases[$i] = $case; $i++; } while ($choice = $this->in(__('What test case would you like to run?'), null, 'q')) { if (is_numeric($choice) && isset($cases[$choice])) { $this->args[0] = $category; $this->args[1] = $cases[$choice]; $this->run($this->parseArgs(), $this->runnerOptions()); break; } if (is_string($choice) && in_array($choice, $cases)) { $this->args[0] = $category; $this->args[1] = $choice; $this->run($this->parseArgs(), $this->runnerOptions()); break; } if ($choice == 'q') { break; } } }