Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updating App::import usage. ran each test and everything seems ok.

  • Loading branch information...
commit 062f471b7ff0f173f34634e0d7ada91c51d4d1aa 1 parent 0c59c13
gwoo authored
Showing with 81 additions and 13,649 deletions.
  1. +3 −2 cake/dispatcher.php
  2. +4 −13 cake/libs/configure.php
  3. +1 −1  cake/libs/controller/components/email.php
  4. +2 −2 cake/libs/controller/controller.php
  5. +1 −1  cake/libs/model/datasources/dbo/dbo_mysqli.php
  6. +2 −1  cake/libs/model/model.php
  7. +1 −1  cake/libs/router.php
  8. +1 −1  cake/libs/view/helpers/app_helper.php
  9. +2 −1  cake/libs/view/view.php
  10. +10 −0 cake/tests/cases/console/cake.test.php
  11. +1 −1  cake/tests/cases/console/libs/acl.test.php
  12. +1 −1  cake/tests/cases/console/libs/api.test.php
  13. +1 −1  cake/tests/cases/console/libs/bake.test.php
  14. +4 −2 cake/tests/cases/console/libs/shell.test.php
  15. +3 −1 cake/tests/cases/console/libs/tasks/controller.test.php
  16. +3 −8 cake/tests/cases/console/libs/tasks/db_config.test.php
  17. +2 −1  cake/tests/cases/console/libs/tasks/extract.test.php
  18. +3 −16 cake/tests/cases/console/libs/tasks/fixture.test.php
  19. +1 −1  cake/tests/cases/console/libs/tasks/model.test.php
  20. +1 −1  cake/tests/cases/console/libs/tasks/plugin.test.php
  21. +1 −1  cake/tests/cases/console/libs/tasks/project.test.php
  22. +1 −1  cake/tests/cases/console/libs/tasks/template.test.php
  23. +7 −27 cake/tests/cases/console/libs/tasks/test.test.php
  24. +1 −1  cake/tests/cases/console/libs/tasks/view.test.php
  25. +1 −1  cake/tests/cases/libs/cake_test_fixture.test.php
  26. +1 −1  cake/tests/cases/libs/code_coverage_manager.test.php
  27. +8 −10 cake/tests/cases/libs/configure.test.php
  28. +2 −1  cake/tests/cases/libs/controller/component.test.php
  29. +2 −2 cake/tests/cases/libs/controller/components/cookie.test.php
  30. +1 −1  cake/tests/cases/libs/controller/components/request_handler.test.php
  31. +1 −1  cake/tests/cases/libs/controller/components/session.test.php
  32. +1 −1  cake/tests/cases/libs/controller/controller.test.php
  33. +1 −1  cake/tests/cases/libs/controller/pages_controller.test.php
  34. +5 −1 cake/tests/cases/libs/i18n.test.php
  35. +0 −13,494 cake/tests/cases/libs/model/model.test.php
  36. +0 −49 cake/tests/cases/libs/model/model_read.test.php
  37. +1 −0  cake/tests/cases/libs/view/helpers/cache.test.php
View
5 cake/dispatcher.php
@@ -30,7 +30,8 @@
/**
* List of helpers to include
*/
-App::import('Core', array('Router', 'Controller'));
+App::import('Core', 'Router');
+App::import('Controller', 'Controller', false);
/**
* Dispatcher translates URLs to controller-action-paramter triads.
@@ -692,7 +693,7 @@ function cached($url) {
if (file_exists($filename)) {
if (!class_exists('View')) {
- App::import('Core', 'View');
+ App::import('View', 'View', false);
}
$controller = null;
$view =& new View($controller, false);
View
17 cake/libs/configure.php
@@ -777,11 +777,9 @@ function objects($type, $path = null, $cache = true) {
}
if ($cache === true) {
- $_this->__objects[$name] = $objects;
$_this->__cache = true;
- } else {
- return $objects;
}
+ $_this->__objects[$name] = $objects;
}
return $_this->__objects[$name];
@@ -976,6 +974,7 @@ function __find($file, $recursive = true) {
}
$Folder =& new Folder();
$directories = $Folder->tree($path, array('.svn', 'tests', 'templates'), 'dir');
+ sort($directories);
$this->__paths[$path] = $directories;
}
@@ -1089,7 +1088,7 @@ function __settings($type, $plugin, $parent) {
switch ($load) {
case 'model':
if (!class_exists('Model')) {
- App::import('Core', 'Model', false, App::core('models'));
+ App::import('Model', 'Model', false, App::core('models'));
}
if (!class_exists('AppModel')) {
App::import($type, 'AppModel', false, App::path('models'));
@@ -1162,15 +1161,7 @@ function __paths($type) {
$paths = array();
if ($type === 'core') {
- $path = App::core();
-
- foreach ($path as $key => $value) {
- $count = count($key);
- for ($i = 0; $i < $count; $i++) {
- $paths[] = $path[$key][$i];
- }
- }
- return $paths;
+ return App::core('libs');
}
if ($paths = App::path($type .'s')) {
return $paths;
View
2  cake/libs/controller/components/email.php
@@ -25,6 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+App::import('Core', 'Multibyte');
/**
* EmailComponent
@@ -36,7 +37,6 @@
* @subpackage cake.cake.libs.controller.components
*
*/
-App::import('Core', 'Multibyte');
class EmailComponent extends Object{
/**
View
4 cake/libs/controller/controller.php
@@ -21,8 +21,8 @@
/**
* Include files
*/
-App::import('Core', array('Component', 'View'));
-
+App::import('Controller', 'Component', false);
+App::import('View', 'View', false);
/**
* Controller
*
View
2  cake/libs/model/datasources/dbo/dbo_mysqli.php
@@ -25,7 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'DboMysql');
+App::import('Datasource', 'DboMysql');
/**
* MySQLi DBO driver object
View
3  cake/libs/model/model.php
@@ -24,8 +24,9 @@
* Included libs
*/
App::import('Core', array(
- 'ClassRegistry', 'Overloadable', 'Validation', 'ModelBehavior', 'ConnectionManager', 'Set', 'String'
+ 'ClassRegistry', 'Overloadable', 'Validation', 'Set', 'String'
));
+App::import('Model', array('ModelBehavior', 'ConnectionManager'), false);
/**
* Object-relational mapper.
View
2  cake/libs/router.php
@@ -31,7 +31,7 @@
*
*/
if (!class_exists('Object')) {
- App::import('Core', 'Object');
+ require LIBS . 'object.php';
}
/**
View
2  cake/libs/view/helpers/app_helper.php
@@ -26,7 +26,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Helper');
+App::import('View', 'Helper', false);
/**
* This is a placeholder class.
View
3  cake/libs/view/view.php
@@ -27,7 +27,8 @@
/**
* Included libraries.
*/
-App::import('Core', array('Helper', 'ClassRegistry'));
+App::import('Core', 'ClassRegistry');
+App::import('View', 'Helper', false);
/**
* View, the V in the MVC triad.
View
10 cake/tests/cases/console/cake.test.php
@@ -110,6 +110,16 @@ function stdout($string, $newline = true) {
}
/**
+ * clear method
+ *
+ * @access public
+ * @return void
+ */
+ function clear() {
+
+ }
+
+/**
* _stop method
*
* @access protected
View
2  cake/tests/cases/console/libs/acl.test.php
@@ -23,7 +23,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
2  cake/tests/cases/console/libs/api.test.php
@@ -23,7 +23,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
2  cake/tests/cases/console/libs/bake.test.php
@@ -18,7 +18,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
6 cake/tests/cases/console/libs/shell.test.php
@@ -25,7 +25,9 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', array('Shell', 'Folder'));
+App::import('Core', 'Folder');
+App::import('Shell', 'Shell', false);
+
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
@@ -350,7 +352,7 @@ function testCreateFile() {
* @access public
*/
function testCreateFileWindows() {
- $this->skipUnless(DIRECTORY_SEPARATOR === '\\', '%s Supported on Windows only');
+ $this->skipUnless(DIRECTORY_SEPARATOR === '\\', 'testCreateFileWindows supported on Windows only');
$path = TMP . 'shell_test';
$file = $path . DS . 'file1.php';
View
4 cake/tests/cases/console/libs/tasks/controller.test.php
@@ -17,7 +17,9 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Shell');
+App::import('Core', 'ClassRegistry');
+App::import('View', 'Helper', false);
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
11 cake/tests/cases/console/libs/tasks/db_config.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
@@ -54,7 +54,7 @@ class TEST_DATABASE_CONFIG {
'database' => 'database_name',
'prefix' => '',
);
-
+
var $otherOne = array(
'driver' => 'mysql',
'persistent' => false,
@@ -73,7 +73,6 @@ class TEST_DATABASE_CONFIG {
* @subpackage cake.tests.cases.console.libs.tasks
*/
class DbConfigTaskTest extends CakeTestCase {
-
/**
* startTest method
*
@@ -89,7 +88,6 @@ function startTest() {
$this->Task->params['working'] = rtrim(APP, '/');
$this->Task->databaseClassName = 'TEST_DATABASE_CONFIG';
}
-
/**
* endTest method
*
@@ -100,7 +98,6 @@ function endTest() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}
-
/**
* Test the getConfig method.
*
@@ -111,7 +108,6 @@ function testGetConfig() {
$result = $this->Task->getConfig();
$this->assertEqual($result, 'otherOne');
}
-
/**
* test that initialize sets the path up.
*
@@ -122,9 +118,8 @@ function testInitialize() {
$this->Task->initialize();
$this->assertFalse(empty($this->Task->path));
$this->assertEqual($this->Task->path, APP . 'config' . DS);
-
+
}
-
/**
* test execute and by extension __interactive
*
View
3  cake/tests/cases/console/libs/tasks/extract.test.php
@@ -25,7 +25,8 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', array('Shell', 'Folder'));
+App::import('Core', 'Folder');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
19 cake/tests/cases/console/libs/tasks/fixture.test.php
@@ -17,7 +17,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
@@ -47,7 +47,6 @@
'Shell', 'MockFixtureModelTask',
array('in', 'out', 'err', 'createFile', '_stop', 'getName', 'getTable', 'listAll')
);
-
/**
* FixtureTaskTest class
*
@@ -55,14 +54,12 @@
* @subpackage cake.tests.cases.console.libs.tasks
*/
class FixtureTaskTest extends CakeTestCase {
-
/**
* fixtures
*
* @var array
**/
var $fixtures = array('core.article', 'core.comment');
-
/**
* startTest method
*
@@ -78,7 +75,6 @@ function startTest() {
$this->Task->Dispatch->shellPaths = App::path('shells');
$this->Task->Template->initialize();
}
-
/**
* endTest method
*
@@ -89,7 +85,6 @@ function endTest() {
unset($this->Task, $this->Dispatcher);
ClassRegistry::flush();
}
-
/**
* test that initialize sets the path
*
@@ -102,7 +97,6 @@ function testConstruct() {
$expected = '/my/path/tests/fixtures/';
$this->assertEqual($Task->path, $expected);
}
-
/**
* test import option array generation
*
@@ -123,7 +117,7 @@ function testImportOptions() {
$result = $this->Task->importOptions('Article');
$expected = array();
$this->assertEqual($result, $expected);
-
+
$this->Task->setReturnValueAt(5, 'in', 'n');
$this->Task->setReturnValueAt(6, 'in', 'n');
$this->Task->setReturnValueAt(7, 'in', 'y');
@@ -131,7 +125,6 @@ function testImportOptions() {
$expected = array('fromTable' => true);
$this->assertEqual($result, $expected);
}
-
/**
* test generating a fixture with database conditions.
*
@@ -150,7 +143,6 @@ function testImportRecordsFromDatabaseWithConditions() {
$this->assertPattern('/Second Article/', $result, 'Missing import data %s');
$this->assertPattern('/Third Article/', $result, 'Missing import data %s');
}
-
/**
* test that execute passes runs bake depending with named model.
*
@@ -164,7 +156,6 @@ function testExecuteWithNamedModel() {
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
$this->Task->execute();
}
-
/**
* test that execute runs all() when args[0] = all
*
@@ -184,7 +175,6 @@ function testExecuteIntoAll() {
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/class CommentFixture/')));
$this->Task->execute();
}
-
/**
* test interactive mode of execute
*
@@ -193,7 +183,7 @@ function testExecuteIntoAll() {
function testExecuteInteractive() {
$this->Task->connection = 'test_suite';
$this->Task->path = '/my/path/';
-
+
$this->Task->setReturnValue('in', 'y');
$this->Task->Model->setReturnValue('getName', 'Article');
$this->Task->Model->setReturnValue('getTable', 'articles', array('Article'));
@@ -202,7 +192,6 @@ function testExecuteInteractive() {
$this->Task->expectAt(0, 'createFile', array($filename, new PatternExpectation('/class ArticleFixture/')));
$this->Task->execute();
}
-
/**
* Test that bake works
*
@@ -236,7 +225,6 @@ function testBake() {
$this->assertNoPattern('/var \$fields/', $result);
$this->assertNoPattern('/var \$records/', $result);
}
-
/**
* Test that file generation includes headers and correct path for plugins.
*
@@ -253,7 +241,6 @@ function testGenerateFixtureFile() {
$this->Task->expectAt(1, 'createFile', array($filename, new PatternExpectation('/\<\?php(.*)\?\>/ms')));
$result = $this->Task->generateFixtureFile('Article', array());
}
-
/**
* test generating files into plugins.
*
View
2  cake/tests/cases/console/libs/tasks/model.test.php
@@ -20,7 +20,7 @@
* @since CakePHP v 1.3
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
2  cake/tests/cases/console/libs/tasks/plugin.test.php
@@ -22,7 +22,7 @@
* @since CakePHP v 1.3.0
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
2  cake/tests/cases/console/libs/tasks/project.test.php
@@ -20,7 +20,7 @@
* @since CakePHP v 1.3.0
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
2  cake/tests/cases/console/libs/tasks/template.test.php
@@ -20,7 +20,7 @@
* @since CakePHP(tm) v 1.3
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
34 cake/tests/cases/console/libs/tasks/test.test.php
@@ -1,6 +1,5 @@
<?php
/* SVN FILE: $Id$ */
-
/**
* TestTaskTest file
*
@@ -22,8 +21,9 @@
* @since CakePHP v 1.2.0.7726
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
-App::import('Core', array('Controller', 'Model'));
+App::import('Shell', 'Shell', false);
+App::import('Controller', 'Controller', false);
+App::import('Model', 'Model', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
@@ -92,12 +92,11 @@ class TestTaskTag extends Model {
)
);
}
-
/**
* Simulated Plugin
**/
class TestTaskAppModel extends Model {
-
+
}
class TestTaskComment extends TestTaskAppModel {
var $name = 'TestTaskComment';
@@ -124,7 +123,6 @@ class TestTaskCommentsController extends Controller {
class TestTaskTest extends CakeTestCase {
var $fixtures = array('core.article', 'core.comment', 'core.articles_tag', 'core.tag');
-
/**
* startTest method
*
@@ -138,7 +136,6 @@ function startTest() {
$this->Task->Dispatch =& $this->Dispatcher;
$this->Task->Template =& new TemplateTask($this->Dispatcher);
}
-
/**
* endTest method
*
@@ -148,7 +145,6 @@ function startTest() {
function endTest() {
ClassRegistry::flush();
}
-
/**
* Test that file path generation doesn't continuously append paths.
*
@@ -172,9 +168,8 @@ function testFilePathGeneration () {
$this->Task->expectAt(2, 'createFile', array($file, '*'));
$this->Task->bake('Controller', 'Comments');
}
-
/**
- * Test that method introspection pulls all relevant non parent class
+ * Test that method introspection pulls all relevant non parent class
* methods into the test case.
*
* @return void
@@ -184,7 +179,6 @@ function testMethodIntrospection() {
$expected = array('doSomething', 'doSomethingElse');
$this->assertEqual($result, $expected);
}
-
/**
* test that the generation of fixtures works correctly.
*
@@ -193,12 +187,11 @@ function testMethodIntrospection() {
function testFixtureArrayGenerationFromModel() {
$subject = ClassRegistry::init('TestTaskArticle');
$result = $this->Task->generateFixtureList($subject);
- $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
+ $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
'app.test_task_article', 'app.test_task_tag');
$this->assertEqual(sort($result), sort($expected));
}
-
/**
* test that the generation of fixtures works correctly.
*
@@ -207,12 +200,11 @@ function testFixtureArrayGenerationFromModel() {
function testFixtureArrayGenerationFromController() {
$subject = new TestTaskCommentsController();
$result = $this->Task->generateFixtureList($subject);
- $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
+ $expected = array('plugin.test_task.test_task_comment', 'app.articles_tags',
'app.test_task_article', 'app.test_task_tag');
$this->assertEqual(sort($result), sort($expected));
}
-
/**
* test user interaction to get object type
*
@@ -227,7 +219,6 @@ function testGetObjectType() {
$result = $this->Task->getObjectType();
$this->assertEqual($result, $this->Task->classTypes[1]);
}
-
/**
* creating test subjects should clear the registry so the registry is always fresh
*
@@ -251,7 +242,6 @@ function testRegistryClearWhenBuildingTestObjects() {
$keys = ClassRegistry::keys();
$this->assertFalse(in_array('random', $keys));
}
-
/**
* test that getClassName returns the user choice as a classname.
*
@@ -272,7 +262,6 @@ function testGetClassName() {
$options = Configure::listObjects('model');
$this->assertEqual($result, $options[0]);
}
-
/**
* Test the user interaction for defining additional fixtures.
*
@@ -285,7 +274,6 @@ function testGetUserFixtures() {
$expected = array('app.pizza', 'app.topping', 'app.side_dish');
$this->assertEqual($result, $expected);
}
-
/**
* test that resolving classnames works
*
@@ -307,7 +295,6 @@ function testGetRealClassname() {
$result = $this->Task->getRealClassname('Component', 'Auth');
$this->assertEqual($result, 'AuthComponent');
}
-
/**
* test baking files.
*
@@ -336,7 +323,6 @@ function testBakeModelTest() {
$this->assertPattern("/'app\.test_task_tag'/", $result);
$this->assertPattern("/'app\.articles_tag'/", $result);
}
-
/**
* test baking controller test files, ensure that the stub class is generated.
*
@@ -366,7 +352,6 @@ function testBakeControllerTest() {
$this->assertPattern("/'app\.test_task_tag'/", $result);
$this->assertPattern("/'app\.articles_tag'/", $result);
}
-
/**
* test Constructor generation ensure that constructClasses is called for controllers
*
@@ -385,7 +370,6 @@ function testGenerateContsructor() {
$expected = "new FormHelper()\n";
$this->assertEqual($result, $expected);
}
-
/**
* Test that mock class generation works for the appropriate classes
*
@@ -395,7 +379,6 @@ function testMockClassGeneration() {
$result = $this->Task->hasMockClass('controller');
$this->assertTrue($result);
}
-
/**
* test bake() with a -plugin param
*
@@ -408,7 +391,6 @@ function testBakeWithPlugin() {
$this->Task->expectAt(0, 'createFile', array($path, '*'));
$this->Task->bake('Helper', 'Form');
}
-
/**
* Test filename generation for each type + plugins
*
@@ -442,7 +424,6 @@ function testTestCaseFileName() {
$expected = APP . 'plugins' . DS . 'test_test' . DS . 'tests' . DS . 'cases' . DS . 'models' . DS . 'post.test.php';
$this->assertEqual($result, $expected);
}
-
/**
* test execute with a type defined
*
@@ -455,7 +436,6 @@ function testExecuteWithOneArg() {
$this->Task->expectAt(0, 'createFile', array('*', new PatternExpectation('/class TestTaskTagTestCase extends CakeTestCase/')));
$this->Task->execute();
}
-
/**
* test execute with type and class name defined
*
View
2  cake/tests/cases/console/libs/tasks/view.test.php
@@ -20,7 +20,7 @@
* @since CakePHP v 1.2.0.7726
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
-App::import('Core', 'Shell');
+App::import('Shell', 'Shell', false);
if (!defined('DISABLE_AUTO_DISPATCH')) {
define('DISABLE_AUTO_DISPATCH', true);
View
2  cake/tests/cases/libs/cake_test_fixture.test.php
@@ -25,7 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-App::import('Core', 'DboSource');
+App::import('Datasource', 'DboSource', false);
/**
* CakeTestFixtureTestFixture class
View
2  cake/tests/cases/libs/code_coverage_manager.test.php
@@ -25,7 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-App::import('Core', 'CodeCoverageManager');
+require_once CAKE . 'tests' . DS . 'lib' . DS . 'code_coverage_manager.php';
require_once CAKE . 'tests' . DS . 'lib' . DS . 'cli_reporter.php';
require_once CAKE . 'tests' . DS . 'lib' . DS . 'cake_reporter.php';
View
18 cake/tests/cases/libs/configure.test.php
@@ -121,23 +121,21 @@ function testWrite() {
Configure::write('SomeName.someKey', null);
$result = Configure::read('SomeName.someKey');
$this->assertEqual($result, null);
-
+
$expected = array('One' => array('Two' => array('Three' => array('Four' => array('Five' => 'cool')))));
Configure::write('Key', $expected);
-
+
$result = Configure::read('Key');
$this->assertEqual($expected, $result);
-
+
$result = Configure::read('Key.One');
$this->assertEqual($expected['One'], $result);
-
-
+
$result = Configure::read('Key.One.Two');
$this->assertEqual($expected['One']['Two'], $result);
-
+
$result = Configure::read('Key.One.Two.Three.Four.Five');
$this->assertEqual('cool', $result);
-
}
/**
@@ -387,13 +385,13 @@ function testClassLoading() {
$file = App::import('Model', 'Model', false);
$this->assertTrue($file);
-
+
$file = App::import('Controller', 'Controller', false);
$this->assertTrue($file);
-
+
$file = App::import('Component', 'Component', false);
$this->assertTrue($file);
-
+
$file = App::import('Shell', 'Shell', false);
$this->assertTrue($file);
View
3  cake/tests/cases/libs/controller/component.test.php
@@ -25,7 +25,8 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-App::import('Core', array('Component', 'Controller'));
+App::import('Controller', 'Controller', false);
+App::import('Controller', 'Component', false);
if (!class_exists('AppController')) {
View
4 cake/tests/cases/libs/controller/components/cookie.test.php
@@ -25,8 +25,8 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-App::import('Core', array('Component', 'Controller', 'Cookie'));
-
+App::import('Controller', array('Component', 'Controller'), false);
+App::import('Component', 'Cookie');
/**
* CookieComponentTestController class
*
View
2  cake/tests/cases/libs/controller/components/request_handler.test.php
@@ -25,7 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-App::import('Core', array('Controller'));
+App::import('Controller', 'Controller', false);
App::import('Component', array('RequestHandler'));
Mock::generatePartial('RequestHandlerComponent', 'NoStopRequestHandler', array('_stop'));
View
2  cake/tests/cases/libs/controller/components/session.test.php
@@ -25,7 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
-App::import('Core', array('Controller', 'Object'));
+App::import('Controller', 'Controller', false);
App::import('Component', 'Session');
/**
View
2  cake/tests/cases/libs/controller/controller.test.php
@@ -19,7 +19,7 @@
* @since CakePHP(tm) v 1.2.0.5436
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-App::import('Core', 'Controller');
+App::import('Controller', 'Controller', false);
App::import('Component', 'Security');
App::import('Component', 'Cookie');
View
2  cake/tests/cases/libs/controller/pages_controller.test.php
@@ -30,7 +30,7 @@
} elseif (!defined('APP_CONTROLLER_EXISTS')) {
define('APP_CONTROLLER_EXISTS', true);
}
-App::import('Core', array('Controller', 'PagesController'));
+App::import('Controller', 'Pages');
/**
* PagesControllerTest class
View
6 cake/tests/cases/libs/i18n.test.php
@@ -42,10 +42,12 @@ class I18nTest extends CakeTestCase {
* @return void
*/
function setUp() {
+ Cache::delete('object_map', '_cake_core_');
App::build(array(
'locales' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'locale'),
'plugins' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins')
- ));
+ ), true);
+ App::objects('plugin', null, false);
}
/**
@@ -55,7 +57,9 @@ function setUp() {
* @return void
*/
function tearDown() {
+ Cache::delete('object_map', '_cake_core_');
App::build();
+ App::objects('plugin', null, false);
}
/**
View
13,494 cake/tests/cases/libs/model/model.test.php
0 additions, 13,494 deletions not shown
View
49 cake/tests/cases/libs/model/model_read.test.php
@@ -3656,56 +3656,7 @@ function testFindNeighbors() {
$expected = array('prev' => $two, 'next' => null);
$this->assertEqual($result, $expected);
}
-/**
- * test findNeighbours() method
- *
- * @return void
- * @access public
- */
- function testFindNeighboursLegacy() {
- $this->loadFixtures('User', 'Article');
- $TestModel =& new Article();
-
- $result = $TestModel->findNeighbours(null, 'Article.id', '2');
- $expected = array(
- 'prev' => array(
- 'Article' => array(
- 'id' => 1
- )),
- 'next' => array(
- 'Article' => array(
- 'id' => 3
- )));
- $this->assertEqual($result, $expected);
-
- $result = $TestModel->findNeighbours(null, 'Article.id', '3');
- $expected = array(
- 'prev' => array(
- 'Article' => array(
- 'id' => 2
- )),
- 'next' => array()
- );
- $this->assertEqual($result, $expected);
- $result = $TestModel->findNeighbours(
- array('User.id' => 1),
- array('Article.id', 'Article.title'),
- 2
- );
- $expected = array(
- 'prev' => array(
- 'Article' => array(
- 'id' => 1,
- 'title' => 'First Article'
- )),
- 'next' => array(
- 'Article' => array(
- 'id' => 3,
- 'title' => 'Third Article'
- )));
- $this->assertEqual($result, $expected);
- }
/**
* testFindCombinedRelations method
*
View
1  cake/tests/cases/libs/view/helpers/cache.test.php
@@ -120,6 +120,7 @@ function endCase() {
* @return void
*/
function tearDown() {
+ clearCache();
unset($this->Cache);
}
Please sign in to comment.
Something went wrong with that request. Please try again.