Skip to content

Commit

Permalink
Fxing ProjectTask tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 7, 2011
1 parent 0be09cb commit a56c4bf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions lib/Cake/Console/Command/Task/ProjectTask.php
Expand Up @@ -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
Expand Down Expand Up @@ -237,9 +239,6 @@ public function securitySalt($path) {
$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)) {
Expand Down
3 changes: 1 addition & 2 deletions lib/Cake/Console/templates/skel/console/cake.php
Expand Up @@ -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);

2 changes: 1 addition & 1 deletion lib/Cake/Console/templates/skel/webroot/test.php
Expand Up @@ -49,7 +49,7 @@
*
*/
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT . DS .'lib');
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}

/**
Expand Down
7 changes: 5 additions & 2 deletions lib/Cake/tests/cases/console/shells/tasks/project.test.php
Expand Up @@ -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');

/**
Expand Down Expand Up @@ -67,7 +70,7 @@ public function tearDown() {
* @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);
}
Expand Down

0 comments on commit a56c4bf

Please sign in to comment.