Fixing TestTask so that if you give an invalid class type you get an error.

This commit is contained in:
Mark Story 2010-05-06 07:31:52 -04:00
parent 918e961f7d
commit 5ea4f027db

View file

@ -95,14 +95,12 @@ class TestTask extends BakeTask {
$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);