Fixing controller test file generation

This commit is contained in:
mark_story 2009-05-25 23:57:15 -04:00
parent 518c318887
commit 79568cc742
2 changed files with 6 additions and 3 deletions
cake
console/libs/tasks
tests/cases/console/libs/tasks

View file

@ -159,7 +159,7 @@ class TestTask extends Shell {
if (strpos($this->path, $type) === false) { if (strpos($this->path, $type) === false) {
$this->filePath = $this->path . 'cases' . DS . Inflector::tableize($type) . DS; $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) { if ($made) {
return $out; return $out;
} }

View file

@ -161,13 +161,16 @@ class TestTaskTest extends CakeTestCase {
$this->Task->Dispatch->expectNever('stderr'); $this->Task->Dispatch->expectNever('stderr');
$this->Task->Dispatch->expectNever('_stop'); $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->expectAt(0, 'createFile', array($file, '*'));
$this->Task->bake('Model', 'MyClass'); $this->Task->bake('Model', 'MyClass');
$this->Task->setReturnValueAt(1, 'in', 'y');
$this->Task->expectAt(1, 'createFile', array($file, '*')); $this->Task->expectAt(1, 'createFile', array($file, '*'));
$this->Task->bake('Model', 'MyClass'); $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');
} }
/** /**