Skip to content

Commit

Permalink
Updating testsuite console to search $pluginPaths for plugins.
Browse files Browse the repository at this point in the history
Fixing readability of help in 80 col displays.
Fixes #6329.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8163 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information
markstory committed Apr 30, 2009
1 parent f25cf63 commit cf3f92c
Showing 1 changed file with 29 additions and 21 deletions.
50 changes: 29 additions & 21 deletions cake/console/libs/testsuite.php
Expand Up @@ -156,30 +156,30 @@ function main() {
function help() { function help() {
$this->out('Usage: '); $this->out('Usage: ');
$this->out("\tcake testsuite category test_type file"); $this->out("\tcake testsuite category test_type file");
$this->out("\t\t - category - \"app\", \"core\" or name of a plugin"); $this->out("\t\t- category - \"app\", \"core\" or name of a plugin");
$this->out("\t\t - test_type - \"case\", \"group\" or \"all\""); $this->out("\t\t- test_type - \"case\", \"group\" or \"all\"");
$this->out("\t\t - test_file - file name with folder prefix and without the (test|group).php suffix"); $this->out("\t\t- test_file - file name with folder prefix and without the (test|group).php suffix");
$this->out(''); $this->out('');
$this->out('Examples: '); $this->out('Examples: ');
$this->out("\t\t cake testsuite app all"); $this->out("\t\tcake testsuite app all");
$this->out("\t\t cake testsuite core all"); $this->out("\t\tcake testsuite core all");
$this->out(''); $this->out('');
$this->out("\t\t cake testsuite app case behaviors/debuggable"); $this->out("\t\tcake testsuite app case behaviors/debuggable");
$this->out("\t\t cake testsuite app case models/my_model"); $this->out("\t\tcake testsuite app case models/my_model");
$this->out("\t\t cake testsuite app case controllers/my_controller"); $this->out("\t\tcake testsuite app case controllers/my_controller");
$this->out(''); $this->out('');
$this->out("\t\t cake testsuite core case file"); $this->out("\t\tcake testsuite core case file");
$this->out("\t\t cake testsuite core case router"); $this->out("\t\tcake testsuite core case router");
$this->out("\t\t cake testsuite core case set"); $this->out("\t\tcake testsuite core case set");
$this->out(''); $this->out('');
$this->out("\t\t cake testsuite app group mygroup"); $this->out("\t\tcake testsuite app group mygroup");
$this->out("\t\t cake testsuite core group acl"); $this->out("\t\tcake testsuite core group acl");
$this->out("\t\t cake testsuite core group socket"); $this->out("\t\tcake testsuite core group socket");
$this->out(''); $this->out('');
$this->out("\t\t cake testsuite bugs case models/bug // for the plugin 'bugs' and its test case 'bug'"); $this->out("\t\tcake testsuite bugs case models/bug");
$this->out("\t\t cake testsuite bugs group bug // for the plugin bugs and its test group 'bug'"); $this->out("\t\t // for the plugin 'bugs' and its test case 'models/bug'");
$this->out("\t\t cake testsuite bugs_me case models/bug // for the plugin 'bugs_me' and its test case 'bug'"); $this->out("\t\tcake testsuite bugs group bug");
$this->out("\t\t cake testsuite bugs_me group bug // for the plugin bugs_me and its test group 'bug'"); $this->out("\t\t // for the plugin bugs and its test group 'bug'");
$this->out(''); $this->out('');
$this->out('Code Coverage Analysis: '); $this->out('Code Coverage Analysis: ');
$this->out("\n\nAppend 'cov' to any of the above in order to enable code coverage analysis"); $this->out("\n\nAppend 'cov' to any of the above in order to enable code coverage analysis");
Expand Down Expand Up @@ -312,11 +312,19 @@ function __findFolderByCategory($category) {
); );


if (array_key_exists($category, $paths)) { if (array_key_exists($category, $paths)) {
$folder = $paths[$category]; $folder = $paths[$category] . 'tests';
} else { } else {
$folder = APP.'plugins'.DS.Inflector::underscore($category).DS; $scoredCategory = Inflector::underscore($category);
$folder = APP . 'plugins' . DS . $scoredCategory . DS;
$pluginPaths = Configure::read('pluginPaths');
foreach ($pluginPaths as $path) {
if (file_exists($path . $scoredCategory . DS . 'tests')) {
$folder = $path . $scoredCategory . DS . 'tests';
break;
}
}
} }
return $folder.'tests'; return $folder;
} }
/** /**
* Sets some get vars needed for TestManager * Sets some get vars needed for TestManager
Expand Down

0 comments on commit cf3f92c

Please sign in to comment.