Skip to content
Permalink
Browse files

Fixing controller test file generation

  • Loading branch information...
markstory committed May 26, 2009
1 parent 518c318 commit 79568cc74212d35a4b10d9e7d53a15c8a0cabb7d
Showing with 6 additions and 3 deletions.
  1. +1 −1 cake/console/libs/tasks/test.php
  2. +5 −2 cake/tests/cases/console/libs/tasks/test.test.php
@@ -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;
}
@@ -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');
}
/**

0 comments on commit 79568cc

Please sign in to comment.
You can’t perform that action at this time.