Skip to content

Commit

Permalink
Fixing controller test file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed May 26, 2009
1 parent 518c318 commit 79568cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cake/console/libs/tasks/test.php
Expand Up @@ -159,7 +159,7 @@ function bake($type, $className) {
if (strpos($this->path, $type) === false) {
$this->filePath = $this->path . 'cases' . DS . Inflector::tableize($type) . DS;
}
$made = $this->createFile($this->filePath . Inflector::underscore($className) . '.test.php', $out);
$made = $this->createFile($this->filePath . Inflector::underscore($fullClassName) . '.test.php', $out);
if ($made) {
return $out;
}
Expand Down
7 changes: 5 additions & 2 deletions cake/tests/cases/console/libs/tasks/test.test.php
Expand Up @@ -161,13 +161,16 @@ function testFilePathGeneration () {
$this->Task->Dispatch->expectNever('stderr');
$this->Task->Dispatch->expectNever('_stop');

$this->Task->setReturnValueAt(0, 'in', 'y');
$this->Task->setReturnValue('in', 'y');
$this->Task->expectAt(0, 'createFile', array($file, '*'));
$this->Task->bake('Model', 'MyClass');

$this->Task->setReturnValueAt(1, 'in', 'y');
$this->Task->expectAt(1, 'createFile', array($file, '*'));
$this->Task->bake('Model', 'MyClass');

$file = TESTS . 'cases' . DS . 'controllers' . DS . 'comments_controller.test.php';
$this->Task->expectAt(2, 'createFile', array($file, '*'));
$this->Task->bake('Controller', 'Comments');
}

/**
Expand Down

0 comments on commit 79568cc

Please sign in to comment.