From 5ea4f027db744fba29e94f5a42af0ace13779452 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Thu, 6 May 2010 07:31:52 -0400 Subject: [PATCH] Fixing TestTask so that if you give an invalid class type you get an error. --- cake/console/libs/tasks/test.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index aa5f1a1b5..0b392391a 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/test.php @@ -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);