updating shells for new App::import

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6078 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-11-25 18:49:41 +00:00
parent b6b192fda6
commit 838dd9022d
3 changed files with 8 additions and 10 deletions

View file

@ -221,21 +221,19 @@ class ApiShell extends Shell {
function __loadDependencies($element) {
switch(low($element)) {
case 'behavior':
loadModel(null);
loadBehavior(null);
App::import('Model', 'AppModel');
App::import('Model', 'ModelBehavior');
break;
case 'controller':
loadController(null);
App::import('Controller', 'AppController');
break;
case 'component':
loadComponent(null);
break;
case 'helper':
uses('view'.DS.'helper');
loadHelper(null);
App::import('Helper', 'AppHelper');
break;
case 'model':
loadModel(null);
App::import('Model', 'ModelBehavior');
break;
}
}

View file

@ -458,7 +458,7 @@ class ControllerTask extends Shell {
*/
function __bakeTest($className) {
$out = '<?php '."\n\n";
$out .= "loadController('$className');\n\n";
$out .= "App::import('Controller', '$className');\n\n";
$out .= "class {$className}ControllerTestCase extends CakeTestCase {\n";
$out .= "\tvar \$TestObject = null;\n\n";
$out .= "\tfunction setUp() {\n\t\t\$this->TestObject = new {$className}Controller();\n";

View file

@ -1,4 +1,4 @@
<?php
\<?php
/* SVN FILE: $Id$ */
/**
* The View Tasks handles creating and updating view files.
@ -225,7 +225,7 @@ class ViewTask extends Shell {
}
$controllerClassName = $this->controllerName . 'Controller';
if (!class_exists($this->controllerName . 'Controller') && !loadController($this->controllerName)) {
if (!class_exists($this->controllerName . 'Controller') && !App::import('Controller', $this->controllerName)) {
$file = CONTROLLERS . $this->controllerPath . '_controller.php';
$shortPath = $this->shortPath($file);
$this->err("The file '{$shortPath}' could not be found.\nIn order to bake a view, you'll need to first create the controller.");