Skip to content

Commit

Permalink
Fixing TestTask so that if you give an invalid class type you get an …
Browse files Browse the repository at this point in the history
…error.
  • Loading branch information
markstory committed May 6, 2010
1 parent 918e961 commit 5ea4f02
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cake/console/libs/tasks/test.php
Expand Up @@ -95,14 +95,12 @@ function __interactive($type = null) {
$this->out(sprintf(__("Path: %s", true), $this->path));
$this->hr();

$type = null;
if ($type) {
$type = Inflector::camelize($type);
if (!in_array($type, $this->classTypes)) {
unset($type);
$this->error(sprintf('Incorrect type provided. Please choose one of %s', implode(', ', $this->classTypes)));
}
}
if (!$type) {
} else {
$type = $this->getObjectType();
}
$className = $this->getClassName($type);
Expand Down

0 comments on commit 5ea4f02

Please sign in to comment.