diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index cf751135c..a5f7019a0 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -285,8 +285,7 @@ class App { if (!empty($paths[$type])) { $path = array_flip(array_flip(array_merge( - (array)$paths[$type], self::$__packages[$type], $merge - ))); + (array)$paths[$type], self::$__packages[$type]))); self::$__packages[$type] = array_values($path); } else { $path = array_flip(array_flip(self::$__packages[$type])); diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php index 064e9a37d..4cd769509 100644 --- a/lib/Cake/Model/BehaviorCollection.php +++ b/lib/Cake/Model/BehaviorCollection.php @@ -19,7 +19,7 @@ * @since CakePHP(tm) v 1.2.0.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('ObjectCollection', 'Core'); +App::uses('ObjectCollection', 'Utility'); /** * Model behavior collection class. diff --git a/lib/Cake/Model/Datasource/DboSource.php b/lib/Cake/Model/Datasource/DboSource.php index 83c962a32..c756d6aaa 100755 --- a/lib/Cake/Model/Datasource/DboSource.php +++ b/lib/Cake/Model/Datasource/DboSource.php @@ -18,6 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('DataSource', 'Model/Datasource'); App::uses('String', 'Utility'); App::uses('View', 'View'); diff --git a/lib/Cake/Network/HttpSocket.php b/lib/Cake/Network/HttpSocket.php index 307448cf2..b80bebc12 100644 --- a/lib/Cake/Network/HttpSocket.php +++ b/lib/Cake/Network/HttpSocket.php @@ -18,7 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::uses('CakeSocket', 'Core'); -App::uses('Router', 'Core'); +App::uses('Router', 'Routing'); /** * Cake network socket connection class. diff --git a/lib/Cake/Routing/Router.php b/lib/Cake/Routing/Router.php index 3824fdd0c..9f4d298c8 100644 --- a/lib/Cake/Routing/Router.php +++ b/lib/Cake/Routing/Router.php @@ -286,7 +286,7 @@ class Router { * @return array Array of routes */ public static function redirect($route, $url, $options) { - App::uses('RedirectRoute', 'Core'); + App::uses('RedirectRoute', 'Routing/Route'); $options['routeClass'] = 'RedirectRoute'; return self::connect($route, $url, $options); } diff --git a/lib/Cake/TestSuite/CakeTestCase.php b/lib/Cake/TestSuite/CakeTestCase.php index 95819c5e1..d8fd93038 100644 --- a/lib/Cake/TestSuite/CakeTestCase.php +++ b/lib/Cake/TestSuite/CakeTestCase.php @@ -21,7 +21,6 @@ PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); App::uses('CakeFixtureManager', 'TestSuite/Fixture'); -App::uses('CakeTestModel', 'TestSuite/Fixture'); App::uses('CakeTestFixture', 'TestSuite/Fixture'); /** @@ -30,7 +29,7 @@ App::uses('CakeTestFixture', 'TestSuite/Fixture'); * @package cake * @subpackage cake.cake.tests.lib */ -class CakeTestCase extends PHPUnit_Framework_TestCase { +abstract class CakeTestCase extends PHPUnit_Framework_TestCase { /** * The class responsible for managinf the creation, loading and removing of fixtures diff --git a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php index 4642dc2b4..d67be7f1a 100644 --- a/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php +++ b/lib/Cake/TestSuite/CakeTestSuiteDispatcher.php @@ -18,6 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ +App::uses('TestManager', 'TestSuite'); /** * CakeTestSuiteDispatcher handles web requests to the test suite and runs the correct action. * @@ -201,7 +202,6 @@ class CakeTestSuiteDispatcher { */ function &getManager() { if (empty($this->Manager)) { - require_once CAKE_TESTS_LIB . 'test_manager.php'; $this->Manager = new $this->_managerClass($this->params); } return $this->Manager; @@ -217,13 +217,13 @@ class CakeTestSuiteDispatcher { if (!self::$_Reporter) { $type = strtolower($this->params['output']); $coreClass = 'Cake' . ucwords($this->params['output']) . 'Reporter'; - $coreFile = CAKE_TESTS_LIB . 'reporter/cake_' . $type . '_reporter.php'; - $appClass = $this->params['output'] . 'Reporter'; - $appFile = APPLIBS . 'test_suite/reporter/' . $type . '_reporter.php'; - if (include_once $coreFile) { + App::uses($coreClass, 'TestSuite/Reporter'); + App::uses($appClass, 'TestSuite/Reporter'); + + if (class_exists($coreClass)) { self::$_Reporter = new $coreClass(null, $this->params); - } elseif (include_once $appFile) { + } elseif (class_exists($appClass)) { self::$_Reporter = new $appClass(null, $this->params); } } diff --git a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php index ae4fa081c..802f462ca 100644 --- a/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php +++ b/lib/Cake/TestSuite/Coverage/HtmlCoverageReport.php @@ -17,10 +17,11 @@ * @since CakePHP(tm) v 2.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -require_once dirname(__FILE__) . '/base_coverage_report.php'; PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); +App::uses('BaseCoverageReport', 'TestSuite/Coverage'); + class HtmlCoverageReport extends BaseCoverageReport { /** diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php index ea09473e7..66bf11352 100644 --- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php +++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php @@ -19,6 +19,9 @@ */ PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); +App::uses('ConnectionManager', 'Model'); +App::uses('ClassRegistry', 'Utility'); + class CakeFixtureManager { /** @@ -100,6 +103,7 @@ class CakeFixtureManager { if (isset($this->_loaded[$fixture])) { continue; } + if (strpos($fixture, 'core.') === 0) { $fixture = substr($fixture, strlen('core.')); foreach (App::core('cake') as $key => $path) { diff --git a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php index 186c3fe73..1f4d6331c 100755 --- a/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php +++ b/lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php @@ -17,7 +17,7 @@ * @since CakePHP(tm) v 1.2.0.4433 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -include_once dirname(__FILE__) . DS . 'cake_base_reporter.php'; +App::uses('CakeBaseReporter', 'TestSuite/Reporter'); PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); diff --git a/lib/Cake/TestSuite/TestManager.php b/lib/Cake/TestSuite/TestManager.php index cf56a20b7..2498f106d 100644 --- a/lib/Cake/TestSuite/TestManager.php +++ b/lib/Cake/TestSuite/TestManager.php @@ -23,9 +23,11 @@ define('APP_TEST_CASES', TESTS . 'cases'); define('APP_TEST_GROUPS', TESTS . 'groups'); PHP_CodeCoverage_Filter::getInstance()->addFileToBlacklist(__FILE__, 'DEFAULT'); + App::uses('CakeTestSuite', 'TestSuite'); App::uses('CakeTestCase', 'TestSuite'); App::uses('CakeFixtureManager', 'TestSuite/Fixture'); +App::uses('CakeTestModel', 'TestSuite/Fixture'); /** * TestManager is the base class that handles loading and initiating the running diff --git a/lib/Cake/View/Helper.php b/lib/Cake/View/Helper.php index f9d26e447..f0a43a33c 100644 --- a/lib/Cake/View/Helper.php +++ b/lib/Cake/View/Helper.php @@ -20,7 +20,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('Router', 'Core'); +App::uses('Router', 'Routing'); /** * Abstract base class for all other Helpers in CakePHP. diff --git a/lib/Cake/View/Helper/JqueryEngineHelper.php b/lib/Cake/View/Helper/JqueryEngineHelper.php index ce9c017db..bc3d90423 100644 --- a/lib/Cake/View/Helper/JqueryEngineHelper.php +++ b/lib/Cake/View/Helper/JqueryEngineHelper.php @@ -23,7 +23,8 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('JsHelper', 'Helper'); +App::uses('JsHelper', 'View/Helper'); +App::uses('JsBaseEngineHelper', 'View/Helper'); class JqueryEngineHelper extends JsBaseEngineHelper { /** diff --git a/lib/Cake/View/HelperCollection.php b/lib/Cake/View/HelperCollection.php index 99e709c03..fe5f74ad5 100644 --- a/lib/Cake/View/HelperCollection.php +++ b/lib/Cake/View/HelperCollection.php @@ -16,7 +16,7 @@ * @since CakePHP(tm) v 2.0 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -App::uses('ObjectCollection', 'Core'); +App::uses('ObjectCollection', 'Utility'); class HelperCollection extends ObjectCollection { diff --git a/lib/Cake/View/View.php b/lib/Cake/View/View.php index ef241d334..f25469f07 100644 --- a/lib/Cake/View/View.php +++ b/lib/Cake/View/View.php @@ -22,6 +22,7 @@ * Included libraries. */ App::uses('HelperCollection', 'View'); +App::uses('Router', 'Routing'); /** * View, the V in the MVC triad. diff --git a/lib/Cake/bootstrap.php b/lib/Cake/bootstrap.php index a6b0099f6..97f38c04a 100644 --- a/lib/Cake/bootstrap.php +++ b/lib/Cake/bootstrap.php @@ -145,7 +145,7 @@ if (!defined('CAKE_TESTS')) { /** * Path to the test suite. */ - define('CAKE_TESTS_LIB', CAKE_TESTS.'lib'.DS); + define('CAKE_TESTS_LIB', LIBS . 'TestSuite' . DS); /** * Path to the controller test directory. diff --git a/lib/Cake/tests/cases/libs/cake_test_case.test.php b/lib/Cake/tests/cases/libs/cake_test_case.test.php index c0623529d..34d8a4a9b 100644 --- a/lib/Cake/tests/cases/libs/cake_test_case.test.php +++ b/lib/Cake/tests/cases/libs/cake_test_case.test.php @@ -24,7 +24,7 @@ App::uses('Controller', 'Controller'); App::uses('CakeHtmlReporter', 'TestSuite/Reporter'); if (!class_exists('AppController', false)) { - require_once LIBS . 'Controller' . DS . 'app_controller.php'; + require_once LIBS . 'Controller' . DS . 'AppController.php'; } elseif (!defined('APP_CONTROLLER_EXISTS')) { define('APP_CONTROLLER_EXISTS', true); } @@ -38,8 +38,8 @@ if (!class_exists('AppController', false)) { class CakeTestCaseTest extends CakeTestCase { public static function setUpBeforeClass() { - require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php'; - require_once TEST_CAKE_CORE_INCLUDE_PATH . DS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php'; + require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'assert_tags_test_case.php'; + require_once LIBS . 'tests' . DS . 'fixtures' . DS . 'fixturized_test_case.php'; } /** diff --git a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php index 4541b2526..fa851e52e 100644 --- a/lib/Cake/tests/cases/libs/cake_test_fixture.test.php +++ b/lib/Cake/tests/cases/libs/cake_test_fixture.test.php @@ -18,6 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::uses('DboSource', 'Model/Datasource'); +App::uses('Model', 'Model'); /** * CakeTestFixtureTestFixture class diff --git a/lib/Cake/tests/cases/libs/html_coverage_report.test.php b/lib/Cake/tests/cases/libs/html_coverage_report.test.php index 39f41fb60..325271131 100644 --- a/lib/Cake/tests/cases/libs/html_coverage_report.test.php +++ b/lib/Cake/tests/cases/libs/html_coverage_report.test.php @@ -18,7 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ -require_once CAKE . 'tests' . DS . 'lib' . DS . 'coverage' . DS . 'html_coverage_report.php'; +App::uses('HtmlCoverageReport', 'TestSuite/Coverage'); class HtmlCoverageReportTest extends CakeTestCase { /** diff --git a/lib/Cake/tests/cases/libs/set.test.php b/lib/Cake/tests/cases/libs/set.test.php index e17a6af06..e0c5c3348 100644 --- a/lib/Cake/tests/cases/libs/set.test.php +++ b/lib/Cake/tests/cases/libs/set.test.php @@ -18,6 +18,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::uses('Set', 'Utility'); +App::uses('Model', 'Model'); /** * SetTest class diff --git a/lib/Cake/tests/cases/libs/view/helper.test.php b/lib/Cake/tests/cases/libs/view/helper.test.php index f14704e1c..c00ee271c 100644 --- a/lib/Cake/tests/cases/libs/view/helper.test.php +++ b/lib/Cake/tests/cases/libs/view/helper.test.php @@ -20,6 +20,7 @@ App::uses('View', 'View'); App::uses('Helper', 'View'); +App::uses('Model', 'Model'); App::uses('Router', 'Routing'); /** diff --git a/lib/Cake/tests/cases/libs/view/helpers/text.test.php b/lib/Cake/tests/cases/libs/view/helpers/text.test.php index 2ac412374..b867c988a 100644 --- a/lib/Cake/tests/cases/libs/view/helpers/text.test.php +++ b/lib/Cake/tests/cases/libs/view/helpers/text.test.php @@ -17,8 +17,9 @@ * @since CakePHP(tm) v 1.2.0.4206 * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ + App::uses('View', 'View'); -App::uses('TextHelper', 'Helper'); +App::uses('TextHelper', 'View/Helper'); /** * TextHelperTest class diff --git a/lib/Cake/tests/cases/libs/view/view.test.php b/lib/Cake/tests/cases/libs/view/view.test.php index 9824b125a..34ca6ae0f 100644 --- a/lib/Cake/tests/cases/libs/view/view.test.php +++ b/lib/Cake/tests/cases/libs/view/view.test.php @@ -19,6 +19,7 @@ */ App::uses('View', 'View'); +App::uses('Helper', 'View'); App::uses('Controller', 'Controller'); App::uses('CacheHelper', 'View/Helper'); App::uses('ErrorHandler', 'Error');