Browse Source

Fixing bake tasks after most recent changes

Jose Lorenzo Rodriguez 15 years ago
parent
commit
9f5ab79abc

+ 14 - 0
lib/Cake/Console/Command/Task/TestTask.php

@@ -457,4 +457,18 @@ class TestTask extends BakeTask {
 				'help' => __d('cake_console', 'CamelCased name of the plugin to bake tests for.')
 			))->epilog(__d('cake_console', 'Omitting all arguments and options will enter into an interactive mode.'));
 	}
+
+/**
+ * Gets the path for output.  Checks the plugin property
+ * and returns the correct path.
+ *
+ * @return string Path to output.
+ */
+	public function getPath() {
+		$path = $this->path;
+		if (isset($this->plugin)) {
+			$path = $this->_pluginPath($this->plugin) . 'tests' . DS;
+		}
+		return $path;
+	}
 }

+ 1 - 1
lib/Cake/tests/Case/Console/Command/Task/ModelTaskTest.php

@@ -745,7 +745,7 @@ STRINGEND;
 	public function testBakeWithPlugin() {
 		$this->Task->plugin = 'controllerTest';
 
-		$path = APP . 'plugins' . DS . 'controller_test' . DS . 'models' . DS . 'BakeArticle.php';
+		$path = APP . 'plugins' . DS . 'controller_test' . DS . 'Model' . DS . 'BakeArticle.php';
 		$this->Task->expects($this->once())->method('createFile')
 			->with($path, new PHPUnit_Framework_Constraint_PCREMatch('/BakeArticle extends ControllerTestAppModel/'));
 	

+ 1 - 1
lib/Cake/tests/Case/Console/Command/Task/ViewTaskTest.php

@@ -395,7 +395,7 @@ class ViewTaskTest extends CakeTestCase {
 		$this->Task->plugin = 'TestTest';
 		$this->Task->name = 'View';
 
-		$path = APP . 'plugins' . DS . 'test_test' . DS . 'views' . DS . 'view_task_comments' . DS  . 'view.ctp';
+		$path = APP . 'plugins' . DS . 'test_test' . DS . 'View' . DS . 'view_task_comments' . DS  . 'view.ctp';
 		$this->Task->expects($this->once())->method('createFile')
 			->with($path, new PHPUnit_Framework_Constraint_IsAnything());