Permalink
Browse files

Updating testsuite console to search $pluginPaths for plugins.

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...
1 parent f25cf63 commit cf3f92c402a79baa04e831fa83a84871745f05d5 @markstory markstory committed Apr 30, 2009
Showing with 29 additions and 21 deletions.
  1. +29 −21 cake/console/libs/testsuite.php
View
50 cake/console/libs/testsuite.php
@@ -156,30 +156,30 @@ function main() {
function help() {
$this->out('Usage: ');
$this->out("\tcake testsuite category test_type file");
- $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_file - file name with folder prefix and without the (test|group).php suffix");
+ $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_file - file name with folder prefix and without the (test|group).php suffix");
$this->out('');
$this->out('Examples: ');
- $this->out("\t\t cake testsuite app all");
- $this->out("\t\t cake testsuite core all");
+ $this->out("\t\tcake testsuite app all");
+ $this->out("\t\tcake testsuite core all");
$this->out('');
- $this->out("\t\t cake testsuite app case behaviors/debuggable");
- $this->out("\t\t cake testsuite app case models/my_model");
- $this->out("\t\t cake testsuite app case controllers/my_controller");
+ $this->out("\t\tcake testsuite app case behaviors/debuggable");
+ $this->out("\t\tcake testsuite app case models/my_model");
+ $this->out("\t\tcake testsuite app case controllers/my_controller");
$this->out('');
- $this->out("\t\t cake testsuite core case file");
- $this->out("\t\t cake testsuite core case router");
- $this->out("\t\t cake testsuite core case set");
+ $this->out("\t\tcake testsuite core case file");
+ $this->out("\t\tcake testsuite core case router");
+ $this->out("\t\tcake testsuite core case set");
$this->out('');
- $this->out("\t\t cake testsuite app group mygroup");
- $this->out("\t\t cake testsuite core group acl");
- $this->out("\t\t cake testsuite core group socket");
+ $this->out("\t\tcake testsuite app group mygroup");
+ $this->out("\t\tcake testsuite core group acl");
+ $this->out("\t\tcake testsuite core group socket");
$this->out('');
- $this->out("\t\t cake testsuite bugs case models/bug // for the plugin 'bugs' and its test case 'bug'");
- $this->out("\t\t cake testsuite bugs group bug // for the plugin bugs and its test group '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\t cake testsuite bugs_me group bug // for the plugin bugs_me and its test group 'bug'");
+ $this->out("\t\tcake testsuite bugs case models/bug");
+ $this->out("\t\t // for the plugin 'bugs' and its test case 'models/bug'");
+ $this->out("\t\tcake testsuite bugs group bug");
+ $this->out("\t\t // for the plugin bugs and its test group 'bug'");
$this->out('');
$this->out('Code Coverage Analysis: ');
$this->out("\n\nAppend 'cov' to any of the above in order to enable code coverage analysis");
@@ -312,11 +312,19 @@ function __findFolderByCategory($category) {
);
if (array_key_exists($category, $paths)) {
- $folder = $paths[$category];
+ $folder = $paths[$category] . 'tests';
} 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

0 comments on commit cf3f92c

Please sign in to comment.