mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Updating paths in ProjectTask and PluginTask to reflect changed dirs.
Updating tests.
This commit is contained in:
parent
b4f4aeeec7
commit
478e90240d
4 changed files with 11 additions and 8 deletions
|
@ -60,8 +60,8 @@ class PluginTask extends Shell {
|
|||
function execute() {
|
||||
if (empty($this->params['skel'])) {
|
||||
$this->params['skel'] = '';
|
||||
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel') === true) {
|
||||
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel';
|
||||
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
|
||||
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
|
||||
}
|
||||
}
|
||||
$plugin = null;
|
||||
|
|
|
@ -57,8 +57,8 @@ class ProjectTask extends Shell {
|
|||
|
||||
if (empty($this->params['skel'])) {
|
||||
$this->params['skel'] = '';
|
||||
if (is_dir(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel') === true) {
|
||||
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'skel';
|
||||
if (is_dir(CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel') === true) {
|
||||
$this->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,6 @@ class ProjectTask extends Shell {
|
|||
if (!$skel) {
|
||||
$skel = $this->params['skel'];
|
||||
}
|
||||
|
||||
while (!$skel) {
|
||||
$skel = $this->in(sprintf(__("What is the path to the directory layout you wish to copy?\nExample: %s"), APP, null, ROOT . DS . 'myapp' . DS));
|
||||
if ($skel == '') {
|
||||
|
@ -184,7 +183,8 @@ class ProjectTask extends Shell {
|
|||
function createHome($dir) {
|
||||
$app = basename($dir);
|
||||
$path = $dir . 'views' . DS . 'pages' . DS;
|
||||
include(CAKE_CORE_INCLUDE_PATH.DS.'cake'.DS.'console'.DS.'libs'.DS.'templates'.DS.'default'.DS.'views'.DS.'home.ctp');
|
||||
$source = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
|
||||
include($source);
|
||||
return $this->createFile($path.'home.ctp', $output);
|
||||
}
|
||||
|
||||
|
|
|
@ -211,6 +211,9 @@ class PluginTaskTest extends CakeTestCase {
|
|||
|
||||
$this->Task->args = array();
|
||||
$this->Task->execute();
|
||||
|
||||
$Folder =& new Folder($path);
|
||||
$Folder->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -87,7 +87,7 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
**/
|
||||
function _setupTestProject() {
|
||||
$skel = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel';
|
||||
$skel = CAKE_CORE_INCLUDE_PATH . DS . CAKE . 'console' . DS . 'templates' . DS . 'skel';
|
||||
$this->Task->setReturnValueAt(0, 'in', 'y');
|
||||
$this->Task->setReturnValueAt(1, 'in', 'n');
|
||||
$this->Task->bake($this->Task->path . 'bake_test_app', $skel);
|
||||
|
@ -156,7 +156,7 @@ class ProjectTaskTest extends CakeTestCase {
|
|||
* @return void
|
||||
**/
|
||||
function testExecute() {
|
||||
$this->Task->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CONSOLE_LIBS . 'templates' . DS . 'skel';
|
||||
$this->Task->params['skel'] = CAKE_CORE_INCLUDE_PATH . DS . CAKE . DS . 'console' . DS. 'templates' . DS . 'skel';
|
||||
$this->Task->params['working'] = TMP . 'tests' . DS;
|
||||
|
||||
$path = $this->Task->path . 'bake_test_app';
|
||||
|
|
Loading…
Reference in a new issue