From 0cf02ec2f9984806c226ae3cd7e574e8b4349b52 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 4 Dec 2010 15:00:48 -0500 Subject: [PATCH] Fixing issues caused by CORE_PATH not being reliable. --- cake/console/shell_dispatcher.php | 6 +----- cake/tests/cases/libs/app.test.php | 16 +++++++++------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/cake/console/shell_dispatcher.php b/cake/console/shell_dispatcher.php index 3037b8d4f08..a80407613e0 100644 --- a/cake/console/shell_dispatcher.php +++ b/cake/console/shell_dispatcher.php @@ -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); } } } diff --git a/cake/tests/cases/libs/app.test.php b/cake/tests/cases/libs/app.test.php index 5a03cb6233f..079794030f8 100644 --- a/cake/tests/cases/libs/app.test.php +++ b/cake/tests/cases/libs/app.test.php @@ -19,7 +19,7 @@ function testBuild() { $expected = array( APP . 'models' . DS, APP, - ROOT . DS . LIBS . 'model' . DS + LIBS . 'model' . DS ); $this->assertEqual($expected, $old); @@ -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); @@ -51,7 +51,7 @@ function testBuildWithReset() { $expected = array( APP . 'models' . DS, APP, - ROOT . DS . LIBS . 'model' . DS + LIBS . 'model' . DS ); $this->assertEqual($expected, $old); @@ -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); } @@ -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.');