From 79568cc74212d35a4b10d9e7d53a15c8a0cabb7d Mon Sep 17 00:00:00 2001 From: mark_story Date: Mon, 25 May 2009 23:57:15 -0400 Subject: [PATCH] Fixing controller test file generation --- cake/console/libs/tasks/test.php | 2 +- cake/tests/cases/console/libs/tasks/test.test.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/tasks/test.php b/cake/console/libs/tasks/test.php index 718eff60336..43107398654 100644 --- a/cake/console/libs/tasks/test.php +++ b/cake/console/libs/tasks/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; } diff --git a/cake/tests/cases/console/libs/tasks/test.test.php b/cake/tests/cases/console/libs/tasks/test.test.php index 735cb7082b0..d2f122a9444 100644 --- a/cake/tests/cases/console/libs/tasks/test.test.php +++ b/cake/tests/cases/console/libs/tasks/test.test.php @@ -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'); } /**