diff --git a/lib/Cake/Console/Command/Task/TestTask.php b/lib/Cake/Console/Command/Task/TestTask.php index b5b6c501b..b49296ee1 100644 --- a/lib/Cake/Console/Command/Task/TestTask.php +++ b/lib/Cake/Console/Command/Task/TestTask.php @@ -479,6 +479,7 @@ class TestTask extends BakeTask { */ public function generateUses($type, $realType, $className) { $uses = array(); + $type = strtolower($type); if ($type == 'component') { $uses[] = array('ComponentCollection', 'Controller'); $uses[] = array('Component', 'Controller'); diff --git a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php index 6806af826..7eb5fa8b4 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php @@ -491,6 +491,8 @@ class TestTaskTest extends CakeTestCase { $result = $this->Task->bake('Component', 'Example'); + $this->assertContains("App::uses('Component', 'Controller')", $result); + $this->assertContains("App::uses('ComponentCollection', 'Controller')", $result); $this->assertContains("App::uses('ExampleComponent', 'Controller/Component')", $result); $this->assertContains('class ExampleComponentTest extends CakeTestCase', $result);