Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '1.3' into 1.3-jshelper

  • Loading branch information...
commit ec10e90efb15d2a490a40ae2d0fa68a40d7f1b00 2 parents cde9afb + 062f471
@markstory markstory authored
Showing with 139 additions and 13,701 deletions.
  1. +15 −10 app/config/bootstrap.php
  2. +25 −21 cake/console/libs/templates/skel/config/bootstrap.php
  3. +3 −2 cake/dispatcher.php
  4. +15 −36 cake/libs/configure.php
  5. +1 −1  cake/libs/controller/components/email.php
  6. +2 −2 cake/libs/controller/controller.php
  7. +1 −1  cake/libs/model/datasources/dbo/dbo_mysqli.php
  8. +2 −1  cake/libs/model/model.php
  9. +1 −1  cake/libs/router.php
  10. +1 −1  cake/libs/view/helpers/app_helper.php
  11. +2 −1  cake/libs/view/view.php
  12. +10 −0 cake/tests/cases/console/cake.test.php
  13. +1 −1  cake/tests/cases/console/libs/acl.test.php
  14. +1 −1  cake/tests/cases/console/libs/api.test.php
  15. +1 −1  cake/tests/cases/console/libs/bake.test.php
  16. +4 −2 cake/tests/cases/console/libs/shell.test.php
  17. +3 −1 cake/tests/cases/console/libs/tasks/controller.test.php
  18. +3 −8 cake/tests/cases/console/libs/tasks/db_config.test.php
  19. +2 −1  cake/tests/cases/console/libs/tasks/extract.test.php
  20. +3 −16 cake/tests/cases/console/libs/tasks/fixture.test.php
  21. +1 −1  cake/tests/cases/console/libs/tasks/model.test.php
  22. +1 −1  cake/tests/cases/console/libs/tasks/plugin.test.php
  23. +1 −1  cake/tests/cases/console/libs/tasks/project.test.php
  24. +1 −1  cake/tests/cases/console/libs/tasks/template.test.php
  25. +7 −27 cake/tests/cases/console/libs/tasks/test.test.php
  26. +1 −1  cake/tests/cases/console/libs/tasks/view.test.php
  27. +1 −1  cake/tests/cases/libs/cake_test_fixture.test.php
  28. +1 −1  cake/tests/cases/libs/code_coverage_manager.test.php
  29. +15 −8 cake/tests/cases/libs/configure.test.php
  30. +2 −1  cake/tests/cases/libs/controller/component.test.php
  31. +2 −2 cake/tests/cases/libs/controller/components/cookie.test.php
  32. +1 −1  cake/tests/cases/libs/controller/components/request_handler.test.php
  33. +1 −1  cake/tests/cases/libs/controller/components/session.test.php
  34. +1 −1  cake/tests/cases/libs/controller/controller.test.php
  35. +1 −1  cake/tests/cases/libs/controller/pages_controller.test.php
  36. +5 −1 cake/tests/cases/libs/i18n.test.php
  37. +0 −13,494 cake/tests/cases/libs/model/model.test.php
  38. +0 −49 cake/tests/cases/libs/model/model_read.test.php
  39. +1 −0  cake/tests/cases/libs/view/helpers/cache.test.php
View
25 app/config/bootstrap.php
@@ -20,22 +20,27 @@
* @since CakePHP(tm) v 0.10.8.2117
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* The settings below can be used to set additional paths to models, views and controllers.
* This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
*
- * $modelPaths = array('/full/path/to/models/', '/next/full/path/to/models/');
- * $viewPaths = array('/full/path/to/views/', '/next/full/path/to/views/');
- * $controllerPaths = array(/full/path/to/controllers/', '/next/full/path/to/controllers/');
- * $pluginPaths = array('/full/path/to/plugins/', '/next/full/path/to/plugins/');
- * $behaviorPaths = array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/');
- * $componentPaths = array('/full/path/to/components/', '/next/full/path/to/components/');
- * $helperPaths = array('/full/path/to/helpers/', '/next/full/path/to/helpers/');
- * $vendorPaths = array('/full/path/to/vendors/', '/next/full/path/to/vendors/');
- * $shellPaths = array('/full/path/to/shells/', '/next/full/path/to/shells/');
- * $localePaths = array('/full/path/to/locale/', '/next/full/path/to/locale/';
+ * App::build(array(
+ * 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
+ * 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
+ * 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
+ * 'controllers' => array(/full/path/to/controllers/', '/next/full/path/to/controllers/'),
+ * 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
+ * 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
+ * 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
+ * 'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
+ * 'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
+ * 'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
+ * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
+ * ));
*
*/
+
/**
* As of 1.3, additional rules for the inflector are added below
*
View
46 cake/console/libs/templates/skel/config/bootstrap.php
@@ -1,47 +1,51 @@
<?php
-/* SVN FILE: $Id$ */
-
/**
- * Short description for file.
+ * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php
*
- * Long description for file
+ * This is an application wide file to load any function that is not used within a class
+ * define. You can also use this to include or require any files in your application.
*
* PHP versions 4 and 5
*
- * CakePHP(tm) : Rapid Development Framework (http://www.cakephp.org)
- * Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
- * @filesource
- * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
- * @link http://www.cakefoundation.org/projects/info/cakephp CakePHP(tm) Project
+ * @copyright Copyright 2005-2008, Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link http://cakephp.org CakePHP(tm) Project
* @package cake
* @subpackage cake.app.config
* @since CakePHP(tm) v 0.10.8.2117
- * @version $Revision$
- * @modifiedby $LastChangedBy$
- * @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
/**
+ * The settings below can be used to set additional paths to models, views and controllers.
+ * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
*
- * This file is loaded automatically by the app/webroot/index.php file after the core bootstrap.php is loaded
- * This is an application wide file to load any function that is not used within a class define.
- * You can also use this to include or require any files in your application.
+ * App::build(array(
+ * 'plugins' => array('/full/path/to/plugins/', '/next/full/path/to/plugins/'),
+ * 'models' => array('/full/path/to/models/', '/next/full/path/to/models/'),
+ * 'views' => array('/full/path/to/views/', '/next/full/path/to/views/'),
+ * 'controllers' => array(/full/path/to/controllers/', '/next/full/path/to/controllers/'),
+ * 'datasources' => array('/full/path/to/datasources/', '/next/full/path/to/datasources/'),
+ * 'behaviors' => array('/full/path/to/behaviors/', '/next/full/path/to/behaviors/'),
+ * 'components' => array('/full/path/to/components/', '/next/full/path/to/components/'),
+ * 'helpers' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
+ * 'vendors' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
+ * 'shells' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
+ * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
+ * ));
*
*/
/**
- * The settings below can be used to set additional paths to models, views and controllers.
- * This is related to Ticket #470 (https://trac.cakephp.org/ticket/470)
+ * As of 1.3, additional rules for the inflector are added below
*
- * $modelPaths = array('full path to models', 'second full path to models', 'etc...');
- * $viewPaths = array('this path to views', 'second full path to views', 'etc...');
- * $controllerPaths = array('this path to controllers', 'second full path to controllers', 'etc...');
+ * Inflector::rule('singular', array('rules' => array(), irregular' => array(), 'uninflected' => array()));
+ * Inflector::rule('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*
*/
-//EOF
?>
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
51 cake/libs/configure.php
@@ -25,6 +25,7 @@
* @lastmodified $Date$
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
+
/**
* Configuration class (singleton). Used for managing runtime configuration information.
*
@@ -44,14 +45,6 @@ class Configure extends Object {
var $debug = null;
/**
- * Determines if $__objects cache should be written.
- *
- * @var boolean
- * @access private
- */
- var $__cache = false;
-
-/**
* Returns a singleton instance of the Configure class.
*
* @return Configure instance
@@ -431,17 +424,6 @@ function __loadBootstrap($boot) {
}
}
}
-
-/**
- * Caches the object map when the instance of the Configure class is destroyed
- *
- * @access public
- */
- function __destruct() {
- if ($this->__cache) {
- Cache::write('object_map', array_filter($this->__objects), '_cake_core_');
- }
- }
}
/**
@@ -721,6 +703,7 @@ function core($type = null) {
$paths['cake'][] = $cake;
$paths['libs'][] = $libs;
$paths['models'][] = $libs . 'model' . DS;
+ $paths['datasources'][] = $libs . 'model' . DS . 'datasources' . DS;
$paths['behaviors'][] = $libs . 'model' . DS . 'behaviors' . DS;
$paths['controllers'][] = $libs . 'controller' . DS;
$paths['components'][] = $libs . 'controller' . DS . 'components' . DS;
@@ -764,7 +747,7 @@ function objects($type, $path = null, $cache = true) {
$_this->__objects = Cache::read('object_map', '_cake_core_');
}
- if (empty($_this->__objects) || !isset($_this->__objects[$type]) || $cache !== true) {
+ if (!isset($_this->__objects[$name]) || $cache !== true) {
$types = $_this->types;
if (!isset($types[$type])) {
@@ -792,13 +775,13 @@ function objects($type, $path = null, $cache = true) {
$objects[$key] = Inflector::camelize($value);
}
}
- if ($cache === true && !empty($objects)) {
- $_this->__objects[$name] = $objects;
+
+ if ($cache === true) {
$_this->__cache = true;
- } else {
- return $objects;
}
+ $_this->__objects[$name] = $objects;
}
+
return $_this->__objects[$name];
}
@@ -984,12 +967,14 @@ function __find($file, $recursive = true) {
}
continue;
}
+
if (!isset($this->__paths[$path])) {
if (!class_exists('Folder')) {
require LIBS . 'folder.php';
}
$Folder =& new Folder();
- $directories = $Folder->tree($path, false, 'dir');
+ $directories = $Folder->tree($path, array('.svn', 'tests', 'templates'), 'dir');
+ sort($directories);
$this->__paths[$path] = $directories;
}
@@ -1103,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'));
@@ -1173,22 +1158,15 @@ function __settings($type, $plugin, $parent) {
*/
function __paths($type) {
$type = strtolower($type);
+ $paths = array();
if ($type === 'core') {
- $path = App::core();
- $paths = array();
-
- 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;
}
+ return $paths;
}
/**
@@ -1255,6 +1233,7 @@ function __destruct() {
unset($this->__paths[rtrim($core[0], DS)]);
Cache::write('dir_map', array_filter($this->__paths), '_cake_core_');
Cache::write('file_map', array_filter($this->__map), '_cake_core_');
+ Cache::write('object_map', $this->__objects, '_cake_core_');
}
}
}
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
23 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);
-
}
/**
@@ -385,7 +383,16 @@ function testClassLoading() {
$file = App::import();
$this->assertTrue($file);
- $file = App::import('Core', 'Model', false);
+ $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);
$file = App::import('Model', 'SomeRandomModelThatDoesNotExist', false);
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.