Browse Source

Fix plugin path in shells.

ADmad 11 years ago
parent
commit
8f88e95400
2 changed files with 6 additions and 3 deletions
  1. 3 1
      src/Console/Command/BakeShell.php
  2. 3 2
      src/Console/Command/Task/TestTask.php

+ 3 - 1
src/Console/Command/BakeShell.php

@@ -108,7 +108,7 @@ class BakeShell extends Shell {
 		foreach (Plugin::loaded() as $plugin) {
 			$tasks = $this->_findTasks(
 				$tasks,
-				Plugin::path($plugin),
+				Plugin::path($plugin) . 'src' . DS,
 				Plugin::getNamespace($plugin),
 				$plugin
 			);
@@ -146,6 +146,7 @@ class BakeShell extends Shell {
  * Find task classes in a given path.
  *
  * @param string $path The path to scan.
+ * @param string $namespace Namespace.
  * @return array An array of files that may contain bake tasks.
  */
 	protected function _findClassFiles($path, $namespace) {
@@ -188,6 +189,7 @@ class BakeShell extends Shell {
 /**
  * Quickly bake the MVC
  *
+ * @param string $name Name.
  * @return void
  */
 	public function all($name = null) {

+ 3 - 2
src/Console/Command/Task/TestTask.php

@@ -81,6 +81,8 @@ class TestTask extends BakeTask {
 /**
  * Execution method always used for tasks
  *
+ * @param string $type Class type.
+ * @param string $name Name.
  * @return void
  */
 	public function main($type = null, $name = null) {
@@ -152,7 +154,7 @@ class TestTask extends BakeTask {
 		$classes = [];
 		$base = APP;
 		if ($this->plugin) {
-			$base = Plugin::path($this->plugin);
+			$base = Plugin::path($this->plugin) . 'src' . DS;
 		}
 		$path = $base . str_replace('\\', DS, $namespace);
 		$folder = new Folder($path);
@@ -432,7 +434,6 @@ class TestTask extends BakeTask {
  * Generate the uses() calls for a type & class name
  *
  * @param string $type The Type of object you are generating tests for eg. controller
- * @param string $realType The package name for the class.
  * @param string $fullClassName The Classname of the class the test is being generated for.
  * @return array An array containing used classes
  */