From 8f88e9540034dbe2ac3533b3d87190882242e206 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 6 Jun 2014 23:33:34 +0530 Subject: [PATCH] Fix plugin path in shells. --- src/Console/Command/BakeShell.php | 4 +++- src/Console/Command/Task/TestTask.php | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Console/Command/BakeShell.php b/src/Console/Command/BakeShell.php index 37937024739..3e1fffcec9a 100644 --- a/src/Console/Command/BakeShell.php +++ b/src/Console/Command/BakeShell.php @@ -108,7 +108,7 @@ public function loadTasks() { 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 @@ protected function _findTasks($tasks, $path, $namespace, $prefix = false) { * 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 @@ protected function _findTaskClasses($files) { /** * Quickly bake the MVC * + * @param string $name Name. * @return void */ public function all($name = null) { diff --git a/src/Console/Command/Task/TestTask.php b/src/Console/Command/Task/TestTask.php index c25d7fd942a..78f2a967efc 100644 --- a/src/Console/Command/Task/TestTask.php +++ b/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 @@ protected function _getClassOptions($namespace) { $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 @@ public function generateConstructor($type, $fullClassName) { * 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 */