Skip to content

Commit

Permalink
Fixing missing imports in generated tests.
Browse files Browse the repository at this point in the history
Fixes #3059
  • Loading branch information
markstory committed Jul 24, 2012
1 parent e6ef218 commit 35bf309
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/Cake/Console/Command/Task/TestTask.php
Expand Up @@ -479,6 +479,7 @@ public function generateConstructor($type, $fullClassName, $plugin) {
*/
public function generateUses($type, $realType, $className) {
$uses = array();
$type = strtolower($type);
if ($type == 'component') {
$uses[] = array('ComponentCollection', 'Controller');
$uses[] = array('Component', 'Controller');
Expand Down
2 changes: 2 additions & 0 deletions lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
Expand Up @@ -491,6 +491,8 @@ public function testBakeComponentTest() {

$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);

Expand Down

0 comments on commit 35bf309

Please sign in to comment.