Fxing ProjectTask tests

This commit is contained in:
Jose Lorenzo Rodriguez 2011-03-07 01:25:05 -04:30
parent 0be09cbfb3
commit a56c4bff77
4 changed files with 9 additions and 8 deletions

View file

@ -19,6 +19,8 @@
*/
App::uses('File', 'Utility');
App::uses('String', 'Utility');
App::uses('Security', 'Utility');
/**
* Task class for creating new project apps and plugins
@ -237,9 +239,6 @@ class ProjectTask extends Shell {
$File = new File($path . 'config' . DS . 'core.php');
$contents = $File->read();
if (preg_match('/([\s]*Configure::write\(\'Security.salt\',[\s\'A-z0-9]*\);)/', $contents, $match)) {
if (!class_exists('Security')) {
require LIBS . 'security.php';
}
$string = Security::generateAuthKey();
$result = str_replace($match[0], "\t" . 'Configure::write(\'Security.salt\', \''.$string.'\');', $contents);
if ($File->write($result)) {

View file

@ -19,7 +19,6 @@
* @since CakePHP(tm) v 1.2.0.5012
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR. 'ShellDispatcher.php');
require_once(__CAKE_PATH__ . 'shell_dispatcher.php');
return ShellDispatcher::run($argv);

View file

@ -49,7 +49,7 @@ ini_set('display_errors', 1);
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS .'lib');
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
/**

View file

@ -20,8 +20,11 @@
*/
App::uses('ShellDispatcher', 'Console');
App::uses('ConsoleOutput', 'Console');
App::uses('ConsoleInput', 'Console');
App::uses('Shell', 'Console');
App::uses('ProjecTask', 'Console/Command/Task');
App::uses('ProjectTask', 'Console/Command/Task');
App::uses('Folder', 'Utility');
App::uses('File', 'Utility');
/**
@ -67,7 +70,7 @@ class ProjectTaskTest extends CakeTestCase {
* @return void
*/
protected function _setupTestProject() {
$skel = CAKE . 'console' . DS . 'templates' . DS . 'skel';
$skel = LIBS . 'Console' . DS . 'templates' . DS . 'skel';
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
$this->Task->bake($this->Task->path . 'bake_test_app', $skel);
}