|
|
@@ -139,7 +139,7 @@ class TestTask extends BakeTask {
|
|
|
$methods = $this->getTestableMethods($fullClassName);
|
|
|
}
|
|
|
$mock = $this->hasMockClass($type, $fullClassName);
|
|
|
- list($preConstruct, $construction, $postConstruct) = $this->generateConstructor($type, $fullClassName);
|
|
|
+ list($preConstruct, $construction, $postConstruct) = $this->generateConstructor($type, $fullClassName, $plugin);
|
|
|
$uses = $this->generateUses($type, $realType, $fullClassName);
|
|
|
|
|
|
$this->out("\n" . __d('cake_console', 'Baking test case for %s %s ...', $className, $type), 1, Shell::QUIET);
|
|
|
@@ -446,13 +446,14 @@ class TestTask extends BakeTask {
|
|
|
*
|
|
|
* @param string $type The Type of object you are generating tests for eg. controller
|
|
|
* @param string $fullClassName The Classname of the class the test is being generated for.
|
|
|
+ * @param string $plugin The plugin name.
|
|
|
* @return array Constructor snippets for the thing you are building.
|
|
|
*/
|
|
|
- public function generateConstructor($type, $fullClassName) {
|
|
|
+ public function generateConstructor($type, $fullClassName, $plugin) {
|
|
|
$type = strtolower($type);
|
|
|
$pre = $post = '';
|
|
|
if ($type == 'model') {
|
|
|
- $construct = "ClassRegistry::init('$fullClassName');\n";
|
|
|
+ $construct = "ClassRegistry::init('{$plugin}$fullClassName');\n";
|
|
|
}
|
|
|
if ($type == 'behavior') {
|
|
|
$construct = "new $fullClassName();\n";
|