Permalink
Browse files

Adding missing variable.

Adding Test case for previous commit.
  • Loading branch information...
1 parent 2af5318 commit b39b38aac99909b1cc8a9b2b0486c6563f5c8e60 @markstory markstory committed Nov 10, 2009
Showing with 6 additions and 1 deletion.
  1. +2 −1 cake/console/libs/tasks/project.php
  2. +4 −0 cake/tests/cases/console/libs/tasks/project.test.php
@@ -236,7 +236,8 @@ function corePath($path) {
$File =& new File($path . 'webroot' . DS . 'test.php');
$contents = $File->read();
if (preg_match('/([\\t\\x20]*define\\(\\\'CAKE_CORE_INCLUDE_PATH\\\',[\\t\\x20\'A-z0-9]*\\);)/', $contents, $match)) {
- $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', ". (strpos(CAKE_CORE_INCLUDE_PATH, '/')===0? " DS . '":"'") . str_replace('/', '\' . DS . \'', trim(CAKE_CORE_INCLUDE_PATH, '/')) . "');", $contents);
+ $root = strpos(CAKE_CORE_INCLUDE_PATH, '/') === 0 ? " DS . '" : "'";
+ $result = str_replace($match[0], "\t\tdefine('CAKE_CORE_INCLUDE_PATH', " . $root . str_replace(DS, "' . DS . '", trim(CAKE_CORE_INCLUDE_PATH, DS)) . "');", $contents);
if (!$File->write($result)) {
return false;
}
@@ -144,6 +144,10 @@ function testIndexPhpGeneration() {
$file =& new File($path . 'webroot' . DS . 'index.php');
$contents = $file->read();
$this->assertNoPattern('/define\(\'CAKE_CORE_INCLUDE_PATH\', \'ROOT/', $contents);
+
+ $file =& new File($path . 'webroot' . DS . 'test.php');
+ $contents = $file->read();
+ $this->assertNoPattern('/define\(\'CAKE_CORE_INCLUDE_PATH\', \'ROOT/', $contents);
}
/**

0 comments on commit b39b38a

Please sign in to comment.