Skip to content

Commit

Permalink
Fixing issues caused by CORE_PATH not being reliable.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 4, 2010
1 parent dd18efb commit 0cf02ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
6 changes: 1 addition & 5 deletions cake/console/shell_dispatcher.php
Expand Up @@ -90,11 +90,7 @@ function __initConstants() {
define('CAKE_CORE_INCLUDE_PATH', dirname(dirname(dirname(__FILE__))));
define('CAKEPHP_SHELL', true);
if (!defined('CORE_PATH')) {
if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ini_get('include_path'))) {
define('CORE_PATH', null);
} else {
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
}
}
Expand Down
16 changes: 9 additions & 7 deletions cake/tests/cases/libs/app.test.php
Expand Up @@ -19,7 +19,7 @@ function testBuild() {
$expected = array(
APP . 'models' . DS,
APP,
ROOT . DS . LIBS . 'model' . DS
LIBS . 'model' . DS
);
$this->assertEqual($expected, $old);

Expand All @@ -31,7 +31,7 @@ function testBuild() {
'/path/to/models/',
APP . 'models' . DS,
APP,
ROOT . DS . LIBS . 'model' . DS
LIBS . 'model' . DS
);
$this->assertEqual($expected, $new);

Expand All @@ -51,7 +51,7 @@ function testBuildWithReset() {
$expected = array(
APP . 'models' . DS,
APP,
ROOT . DS . LIBS . 'model' . DS
LIBS . 'model' . DS
);
$this->assertEqual($expected, $old);

Expand All @@ -77,13 +77,13 @@ function testBuildWithReset() {
*/
function testCore() {
$model = App::core('models');
$this->assertEqual(array(ROOT . DS . LIBS . 'model' . DS), $model);
$this->assertEqual(array(LIBS . 'model' . DS), $model);

$view = App::core('views');
$this->assertEqual(array(ROOT . DS . LIBS . 'view' . DS), $view);
$this->assertEqual(array(LIBS . 'view' . DS), $view);

$controller = App::core('controllers');
$this->assertEqual(array(ROOT . DS . LIBS . 'controller' . DS), $controller);
$this->assertEqual(array(LIBS . 'controller' . DS), $controller);

}

Expand Down Expand Up @@ -329,7 +329,9 @@ function testImportingHelpersFromAlternatePaths() {
$this->assertFalse(class_exists('BananaHelper'), 'BananaHelper was not found because the path does not exist.');

App::build(array(
'helpers' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS)
'helpers' => array(
TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'helpers' . DS
)
));
App::build(array('vendors' => array(TEST_CAKE_CORE_INCLUDE_PATH)));
$this->assertFalse(class_exists('BananaHelper'), 'BananaHelper exists, cannot test importing it.');
Expand Down

0 comments on commit 0cf02ec

Please sign in to comment.