Partial migration of folders to camelcase in app

This commit is contained in:
Jose Lorenzo Rodriguez 2011-03-22 00:46:51 -04:30
parent ac0ec44f51
commit 6737380deb
154 changed files with 88 additions and 44 deletions

View file

@ -203,7 +203,7 @@ class App {
$path[] = sprintf($f, $pluginPath); $path[] = sprintf($f, $pluginPath);
} }
} }
$path[] = $pluginPath . 'libs' . DS . $type . DS; $path[] = $pluginPath . 'Lib' . DS . $type . DS;
return $path; return $path;
} }
@ -233,32 +233,61 @@ class App {
public static function build($paths = array(), $reset = false) { public static function build($paths = array(), $reset = false) {
if (empty(self::$__packageFormat)) { if (empty(self::$__packageFormat)) {
self::$__packageFormat = array( self::$__packageFormat = array(
'Model' => array('%s' . 'models' . DS), 'Model' => array(
'Model/Behavior' => array('%s' . 'models' . DS . 'behaviors' . DS), '%s' . 'Model' . DS,
'Model/Datasource' => array('%s' . 'models' . DS . 'datasources' . DS), '%s' . 'models' . DS
'Model/Datasource/Database' => array('%s' . 'models' . DS . 'datasources' . DS . 'database' . DS), ),
'Model/Datasource/Session' => array('%s' . 'models' . DS . 'datasources' . DS . 'session' . DS), 'Model/Behavior' => array(
'Controller' => array('%s' . 'controllers' . DS), '%s' . 'Model' . DS . 'Behavior' . DS,
'Controller/Component' => array('%s' . 'controllers' . DS . 'components' . DS), '%s' . 'models' . DS . 'behaviors' . DS
'View' => array('%s' . 'views' . DS), ),
'View/Helper' => array('%s' . 'views' . DS . 'helpers' . DS), 'Model/Datasource' => array(
'%s' . 'Model' . DS . 'Datasource' . DS,
'%s' . 'models' . DS . 'datasources' . DS
),
'Model/Datasource/Database' => array(
'%s' . 'Model' . DS . 'Datasource' . DS . 'Database' . DS,
'%s' . 'models' . DS . 'datasources' . DS . 'database' . DS
),
'Model/Datasource/Session' => array(
'%s' . 'Model' . DS . 'Datasource' . DS . 'Session' . DS,
'%s' . 'models' . DS . 'datasources' . DS . 'session' . DS
),
'Controller' => array(
'%s' . 'Controller' . DS,
'%s' . 'controllers' . DS
),
'Controller/Component' => array(
'%s' . 'Controller' . DS . 'Component' . DS,
'%s' . 'controllers' . DS . 'components' . DS
),
'View' => array(
'%s' . 'View' . DS,
'%s' . 'views' . DS
),
'View/Helper' => array(
'%s' . 'View' . DS . 'Helper' . DS,
'%s' . 'views' . DS . 'helpers' . DS
),
'Console' => array( 'Console' => array(
'%s' . 'console' . DS, '%s' . 'Console' . DS,
'%s' . 'vendors' . DS . 'shells' . DS, '%s' . 'console' . DS
VENDORS . 'shells' . DS
), ),
'Console/Command' => array( 'Console/Command' => array(
'%s' . 'Console' . DS . 'Command' . DS,
'%s' . 'console' . DS . 'shells' . DS, '%s' . 'console' . DS . 'shells' . DS,
'%s' . 'vendors' . DS . 'shells' . DS,
VENDORS . 'shells' . DS
), ),
'Console/Command/Task' => array( 'Console/Command/Task' => array(
'%s' . 'console' . DS . 'shells' . DS . 'tasks' . DS, '%s' . 'Console' . DS . 'Command' . DS . 'Task' . DS,
'%s' . 'vendors' . DS . 'shells' . DS . 'tasks' . DS, '%s' . 'console' . DS . 'shells' . DS . 'tasks' . DS
VENDORS . 'shells' . DS . 'tasks' . DS ),
'Lib' => array(
'%s' . 'Lib' . DS,
'%s' . 'libs' . DS
),
'locales' => array(
'%s' . 'locale' . DS
), ),
'Lib' => array('%s' . 'libs' . DS),
'locales' => array('%s' . 'locale' . DS),
'vendors' => array('%s' . 'vendors' . DS, VENDORS), 'vendors' => array('%s' . 'vendors' . DS, VENDORS),
'plugins' => array(APP . 'plugins' . DS, CAKE_CORE_INCLUDE_PATH . DS . 'plugins' . DS) 'plugins' => array(APP . 'plugins' . DS, CAKE_CORE_INCLUDE_PATH . DS . 'plugins' . DS)
); );

View file

@ -44,7 +44,7 @@ class CommandListTest extends CakeTestCase {
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS
), ),
'Console/Command' => array( 'Console/Command' => array(
LIBS . 'tests' . DS . 'test_app' . DS . 'console' . DS . 'shells' . DS LIBS . 'tests' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
) )
), true); ), true);
App::objects('plugin', null, false); App::objects('plugin', null, false);

View file

@ -70,7 +70,7 @@ class ExtractTaskTest extends CakeTestCase {
public function testExecute() { public function testExecute() {
$this->Task->interactive = false; $this->Task->interactive = false;
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages'; $this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'pages';
$this->Task->params['output'] = $this->path . DS; $this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err'); $this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in') $this->Task->expects($this->any())->method('in')
@ -157,7 +157,7 @@ class ExtractTaskTest extends CakeTestCase {
function testExtractWithExclude() { function testExtractWithExclude() {
$this->Task->interactive = false; $this->Task->interactive = false;
$this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'views'; $this->Task->params['paths'] = LIBS . 'tests' . DS . 'test_app' . DS . 'View';
$this->Task->params['output'] = $this->path . DS; $this->Task->params['output'] = $this->path . DS;
$this->Task->params['exclude'] = 'pages,layouts'; $this->Task->params['exclude'] = 'pages,layouts';
@ -184,8 +184,8 @@ class ExtractTaskTest extends CakeTestCase {
$this->Task->interactive = false; $this->Task->interactive = false;
$this->Task->params['paths'] = $this->Task->params['paths'] =
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'pages,' . LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'pages,' .
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'posts'; LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS . 'posts';
$this->Task->params['output'] = $this->path . DS; $this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err'); $this->Task->expects($this->never())->method('err');

View file

@ -16,6 +16,7 @@ class AppImportTest extends CakeTestCase {
function testBuild() { function testBuild() {
$old = App::path('Model'); $old = App::path('Model');
$expected = array( $expected = array(
APP . 'Model' . DS,
APP . 'models' . DS APP . 'models' . DS
); );
$this->assertEqual($expected, $old); $this->assertEqual($expected, $old);
@ -26,6 +27,7 @@ class AppImportTest extends CakeTestCase {
$expected = array( $expected = array(
'/path/to/models/', '/path/to/models/',
APP . 'Model' . DS,
APP . 'models' . DS APP . 'models' . DS
); );
$this->assertEqual($expected, $new); $this->assertEqual($expected, $new);
@ -44,6 +46,7 @@ class AppImportTest extends CakeTestCase {
function testCompatibleBuild() { function testCompatibleBuild() {
$old = App::path('models'); $old = App::path('models');
$expected = array( $expected = array(
APP . 'Model' . DS,
APP . 'models' . DS APP . 'models' . DS
); );
$this->assertEqual($expected, $old); $this->assertEqual($expected, $old);
@ -54,6 +57,7 @@ class AppImportTest extends CakeTestCase {
$expected = array( $expected = array(
'/path/to/models/', '/path/to/models/',
APP . 'Model' . DS,
APP . 'models' . DS APP . 'models' . DS
); );
$this->assertEqual($expected, $new); $this->assertEqual($expected, $new);
@ -62,6 +66,7 @@ class AppImportTest extends CakeTestCase {
App::build(array('datasources' => array('/path/to/datasources/'))); App::build(array('datasources' => array('/path/to/datasources/')));
$expected = array( $expected = array(
'/path/to/datasources/', '/path/to/datasources/',
APP . 'Model' . DS . 'Datasource' . DS,
APP . 'models' . DS . 'datasources' . DS APP . 'models' . DS . 'datasources' . DS
); );
$result = App::path('datasources'); $result = App::path('datasources');
@ -71,6 +76,7 @@ class AppImportTest extends CakeTestCase {
App::build(array('behaviors' => array('/path/to/behaviors/'))); App::build(array('behaviors' => array('/path/to/behaviors/')));
$expected = array( $expected = array(
'/path/to/behaviors/', '/path/to/behaviors/',
APP . 'Model' . DS . 'Behavior' . DS,
APP . 'models' . DS . 'behaviors' . DS APP . 'models' . DS . 'behaviors' . DS
); );
$result = App::path('behaviors'); $result = App::path('behaviors');
@ -80,6 +86,7 @@ class AppImportTest extends CakeTestCase {
App::build(array('controllers' => array('/path/to/controllers/'))); App::build(array('controllers' => array('/path/to/controllers/')));
$expected = array( $expected = array(
'/path/to/controllers/', '/path/to/controllers/',
APP . 'Controller' . DS,
APP . 'controllers' . DS APP . 'controllers' . DS
); );
$result = App::path('controllers'); $result = App::path('controllers');
@ -89,6 +96,7 @@ class AppImportTest extends CakeTestCase {
App::build(array('components' => array('/path/to/components/'))); App::build(array('components' => array('/path/to/components/')));
$expected = array( $expected = array(
'/path/to/components/', '/path/to/components/',
APP . 'Controller' . DS . 'Component' . DS,
APP . 'controllers' . DS . 'components' . DS APP . 'controllers' . DS . 'components' . DS
); );
$result = App::path('components'); $result = App::path('components');
@ -98,6 +106,7 @@ class AppImportTest extends CakeTestCase {
App::build(array('views' => array('/path/to/views/'))); App::build(array('views' => array('/path/to/views/')));
$expected = array( $expected = array(
'/path/to/views/', '/path/to/views/',
APP . 'View' . DS,
APP . 'views' . DS APP . 'views' . DS
); );
$result = App::path('views'); $result = App::path('views');
@ -107,6 +116,7 @@ class AppImportTest extends CakeTestCase {
App::build(array('helpers' => array('/path/to/helpers/'))); App::build(array('helpers' => array('/path/to/helpers/')));
$expected = array( $expected = array(
'/path/to/helpers/', '/path/to/helpers/',
APP . 'View' . DS . 'Helper' .DS,
APP . 'views' . DS . 'helpers' . DS APP . 'views' . DS . 'helpers' . DS
); );
$result = App::path('helpers'); $result = App::path('helpers');
@ -116,9 +126,8 @@ class AppImportTest extends CakeTestCase {
App::build(array('shells' => array('/path/to/shells/'))); App::build(array('shells' => array('/path/to/shells/')));
$expected = array( $expected = array(
'/path/to/shells/', '/path/to/shells/',
APP . 'Console' . DS . 'Command' . DS,
APP . 'console' . DS . 'shells' . DS, APP . 'console' . DS . 'shells' . DS,
APP . 'vendors' . DS . 'shells' . DS,
ROOT . DS . 'vendors' . DS . 'shells' . DS
); );
$result = App::path('shells'); $result = App::path('shells');
$this->assertEqual($expected, $result); $this->assertEqual($expected, $result);
@ -138,6 +147,7 @@ class AppImportTest extends CakeTestCase {
function testBuildWithReset() { function testBuildWithReset() {
$old = App::path('Model'); $old = App::path('Model');
$expected = array( $expected = array(
APP . 'Model' . DS,
APP . 'models' . DS APP . 'models' . DS
); );
$this->assertEqual($expected, $old); $this->assertEqual($expected, $old);

View file

@ -948,7 +948,7 @@ class AuthTest extends CakeTestCase {
*/ */
function testAjaxLogin() { function testAjaxLogin() {
App::build(array( App::build(array(
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
)); ));
$_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest"; $_SERVER['HTTP_X_REQUESTED_WITH'] = "XMLHttpRequest";

View file

@ -670,7 +670,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/ */
function testAjaxRedirectAsRequestAction() { function testAjaxRedirectAsRequestAction() {
App::build(array( App::build(array(
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
), true); ), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components)); $this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
@ -699,7 +699,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
*/ */
function testAjaxRedirectAsRequestActionStillRenderingLayout() { function testAjaxRedirectAsRequestActionStillRenderingLayout() {
App::build(array( App::build(array(
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
), true); ), true);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components)); $this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));

View file

@ -439,8 +439,8 @@ class ControllerTest extends CakeTestCase {
function testLoadModelInPlugins() { function testLoadModelInPlugins() {
App::build(array( App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'Controller' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'controllers' . DS), 'Controller' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'Controller' . DS),
'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS) 'Model' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS)
)); ));
App::uses('TestPluginAppController', 'TestPlugin.Controller'); App::uses('TestPluginAppController', 'TestPlugin.Controller');
App::uses('TestPluginController', 'TestPlugin.Controller'); App::uses('TestPluginController', 'TestPlugin.Controller');
@ -578,7 +578,7 @@ class ControllerTest extends CakeTestCase {
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
App::build(array( App::build(array(
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
)); ));
$Controller = new Controller($request); $Controller = new Controller($request);
$Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); $Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
@ -640,7 +640,7 @@ class ControllerTest extends CakeTestCase {
*/ */
function testRender() { function testRender() {
App::build(array( App::build(array(
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
), true); ), true);
$request = new CakeRequest('controller_posts/index'); $request = new CakeRequest('controller_posts/index');
$request->params['action'] = 'index'; $request->params['action'] = 'index';
@ -684,11 +684,9 @@ class ControllerTest extends CakeTestCase {
* @return void * @return void
*/ */
function testComponentBeforeRenderChangingViewClass() { function testComponentBeforeRenderChangingViewClass() {
$core = App::core('views');
App::build(array( App::build(array(
'views' => array( 'View' => array(
LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS, LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS
$core[0]
) )
), true); ), true);
$Controller = new Controller($this->getMock('CakeRequest')); $Controller = new Controller($this->getMock('CakeRequest'));

View file

@ -44,7 +44,9 @@ class PagesControllerTest extends CakeTestCase {
*/ */
function testDisplay() { function testDisplay() {
App::build(array( App::build(array(
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS, LIBS . 'libs' . DS . 'view' . DS) 'View' => array(
LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS
)
)); ));
$Pages = new PagesController(new CakeRequest(null, false)); $Pages = new PagesController(new CakeRequest(null, false));

View file

@ -141,7 +141,9 @@ class ConnectionManagerTest extends CakeTestCase {
function testGetPluginDataSourceAndLocalDriver() { function testGetPluginDataSourceAndLocalDriver() {
App::build(array( App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'Model/Datasource/Database' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS . 'Database' . DS) 'Model/Datasource/Database' => array(
LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Database' . DS
)
)); ));
$name = 'test_plugin_source_and_local_driver'; $name = 'test_plugin_source_and_local_driver';
@ -262,7 +264,9 @@ class ConnectionManagerTest extends CakeTestCase {
function testConnectionData() { function testConnectionData() {
App::build(array( App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'Model/Datasource' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'models' . DS . 'datasources' . DS) 'Model/Datasource' => array(
LIBS . 'tests' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
)
)); ));
$expected = array( $expected = array(

View file

@ -518,7 +518,7 @@ class HelperTest extends CakeTestCase {
Configure::write('Asset.timestamp', 'force'); Configure::write('Asset.timestamp', 'force');
App::build(array( App::build(array(
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS), 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS),
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS), 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View' . DS),
)); ));
$result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css'); $result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css');
@ -757,7 +757,7 @@ class HelperTest extends CakeTestCase {
$this->Helper->theme = 'test_theme'; $this->Helper->theme = 'test_theme';
App::build(array( App::build(array(
'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views'. DS) 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS)
)); ));
$result = $this->Helper->webroot('/img/cake.power.gif'); $result = $this->Helper->webroot('/img/cake.power.gif');

View file

@ -260,8 +260,9 @@ class ViewTest extends CakeTestCase {
$expected = array( $expected = array(
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS, LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS . 'plugins' . DS . 'test_plugin' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'View' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS, LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'views' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'libs' . DS . 'View' . DS, LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS . 'test_plugin' . DS . 'Lib' . DS . 'View' . DS,
LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS, LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS,
LIBS . 'View' . DS LIBS . 'View' . DS
); );

Some files were not shown because too many files have changed in this diff Show more