Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '2.0' of https://github.com/cakephp/cakephp into 2.0-exc…

…eptionrenderer
  • Loading branch information...
commit ea41915c21aee2dc2e3eb89688dd97cebf18ebba 2 parents c2089a8 + 4ee4e42
@tPl0ch authored
Showing with 650 additions and 643 deletions.
  1. +1 −1  app/webroot/test.php
  2. +6 −3 lib/Cake/Configure/PhpReader.php
  3. +5 −5 lib/Cake/Console/Command/AclShell.php
  4. +8 −8 lib/Cake/Console/Command/ApiShell.php
  5. +1 −1  lib/Cake/Console/Command/ConsoleShell.php
  6. +1 −1  lib/Cake/Console/Command/SchemaShell.php
  7. +3 −2 lib/Cake/Console/Command/Task/ControllerTask.php
  8. +10 −2 lib/Cake/Console/Command/Task/ModelTask.php
  9. +4 −4 lib/Cake/Console/Command/Task/PluginTask.php
  10. +6 −6 lib/Cake/Console/Command/Task/ProjectTask.php
  11. +4 −3 lib/Cake/Console/Command/Task/ViewTask.php
  12. +87 −0 lib/Cake/Console/Command/UpgradeShell.php
  13. +1 −1  lib/Cake/Console/ShellDispatcher.php
  14. +2 −2 lib/Cake/Console/templates/default/views/home.ctp
  15. +1 −1  lib/Cake/Console/templates/skel/webroot/test.php
  16. +12 −12 lib/Cake/Controller/Component/AclComponent.php
  17. +3 −3 lib/Cake/Core/App.php
  18. +8 −8 lib/Cake/Core/Configure.php
  19. +5 −5 lib/Cake/Core/Object.php
  20. +1 −1  lib/Cake/Model/Behavior/AclBehavior.php
  21. +2 −2 lib/Cake/Model/CakeSchema.php
  22. +2 −2 lib/Cake/Model/ConnectionManager.php
  23. +6 −6 lib/Cake/Network/Email/CakeEmail.php
  24. +5 −5 lib/Cake/Routing/Dispatcher.php
  25. +3 −3 lib/Cake/Test/Case/BasicsTest.php
  26. +8 −8 lib/Cake/Test/Case/Cache/CacheTest.php
  27. +2 −2 lib/Cake/Test/Case/Configure/IniReaderTest.php
  28. +2 −2 lib/Cake/Test/Case/Configure/PhpReaderTest.php
  29. +1 −1  lib/Cake/Test/Case/Console/Command/ApiShellTest.php
  30. +3 −3 lib/Cake/Test/Case/Console/Command/CommandListShellTest.php
  31. +11 −11 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
  32. +15 −15 lib/Cake/Test/Case/Console/Command/ShellTest.php
  33. +9 −9 lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php
  34. +14 −14 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
  35. +6 −6 lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php
  36. +5 −5 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
  37. +2 −2 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
  38. +2 −2 lib/Cake/Test/Case/Console/TaskCollectionTest.php
  39. +4 −4 lib/Cake/Test/Case/Controller/Component/AclComponentTest.php
  40. +7 −7 lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php
  41. +9 −9 lib/Cake/Test/Case/Controller/Component/Auth/DigestAuthenticateTest.php
  42. +5 −5 lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticate.php
  43. +4 −4 lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php
  44. +5 −5 lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php
  45. +14 −14 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
  46. +3 −3 lib/Cake/Test/Case/Controller/ComponentCollectionTest.php
  47. +3 −3 lib/Cake/Test/Case/Controller/ComponentTest.php
  48. +7 −7 lib/Cake/Test/Case/Controller/ControllerTest.php
  49. +1 −1  lib/Cake/Test/Case/Controller/PagesControllerTest.php
  50. +17 −17 lib/Cake/Test/Case/Controller/ScaffoldTest.php
  51. +34 −34 lib/Cake/Test/Case/Core/AppTest.php
  52. +6 −6 lib/Cake/Test/Case/Core/CakePluginTest.php
  53. +4 −4 lib/Cake/Test/Case/Core/ConfigureTest.php
  54. +17 −17 lib/Cake/Test/Case/Core/ObjectTest.php
  55. +2 −2 lib/Cake/Test/Case/Error/ErrorHandlerTest.php
  56. +4 −4 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
  57. +6 −6 lib/Cake/Test/Case/I18n/I18nTest.php
  58. +2 −2 lib/Cake/Test/Case/Log/CakeLogTest.php
  59. +5 −5 lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
  60. +3 −3 lib/Cake/Test/Case/Model/CakeSchemaTest.php
  61. +8 −8 lib/Cake/Test/Case/Model/ConnectionManagerTest.php
  62. +10 −10 lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
  63. +4 −4 lib/Cake/Test/Case/Model/Datasource/Database/MssqlTest.php
  64. +2 −2 lib/Cake/Test/Case/Model/Datasource/Database/OrcaleTest.php
  65. +25 −25 lib/Cake/Test/Case/Routing/DispatcherTest.php
  66. +14 −14 lib/Cake/Test/Case/Routing/RouterTest.php
  67. +3 −3 lib/Cake/Test/Case/TestSuite/CakeTestCaseTest.php
  68. +12 −12 lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
  69. +5 −5 lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php
  70. +31 −31 lib/Cake/Test/Case/Utility/FolderTest.php
  71. +5 −5 lib/Cake/Test/Case/Utility/XmlTest.php
  72. +5 −5 lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
  73. +6 −6 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  74. +3 −3 lib/Cake/Test/Case/View/Helper/SessionHelperTest.php
  75. +2 −2 lib/Cake/Test/Case/View/Helper/TimeHelperTest.php
  76. +3 −3 lib/Cake/Test/Case/View/HelperCollectionTest.php
  77. +9 −9 lib/Cake/Test/Case/View/HelperTest.php
  78. +6 −6 lib/Cake/Test/Case/View/MediaViewTest.php
  79. +11 −11 lib/Cake/Test/Case/View/ThemeViewTest.php
  80. +19 −19 lib/Cake/Test/Case/View/ViewTest.php
  81. 0  lib/Cake/Test/test_app/View/Layouts/{emails → Emails}/html/default.ctp
  82. 0  lib/Cake/Test/test_app/View/Layouts/{emails → Emails}/html/thin.ctp
  83. 0  lib/Cake/Test/test_app/View/Layouts/{emails → Emails}/text/default.ctp
  84. +2 −2 lib/Cake/Test/test_app/View/Pages/home.ctp
  85. +3 −3 lib/Cake/Test/test_app/View/Posts/test_nocache_tags.ctp
  86. 0  lib/Cake/Test/test_app/View/Themed/TestTheme/{plugins → Plugins}/TestPlugin/Layouts/plugin_default.ctp
  87. 0  ...ke/Test/test_app/View/Themed/TestTheme/{plugins/TestPlugin/tests → Plugins/TestPlugin/Tests}/index.ctp
  88. +5 −5 lib/Cake/TestSuite/CakeTestSuiteDispatcher.php
  89. +3 −3 lib/Cake/TestSuite/Coverage/BaseCoverageReport.php
  90. +3 −3 lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
  91. +4 −4 lib/Cake/TestSuite/Reporter/CakeHtmlReporter.php
  92. +3 −3 lib/Cake/Utility/Debugger.php
  93. +5 −2 lib/Cake/View/Helper/HtmlHelper.php
  94. +2 −2 lib/Cake/View/Pages/home.ctp
  95. +1 −1  lib/Cake/View/ScaffoldView.php
  96. +4 −4 lib/Cake/basics.php
  97. +3 −99 lib/Cake/bootstrap.php
View
2  app/webroot/test.php
@@ -75,6 +75,6 @@
die(__d('cake', 'Debug setting does not allow access to this url.'));
}
-require_once CAKE_TESTS_LIB . 'CakeTestSuiteDispatcher.php';
+require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';
CakeTestSuiteDispatcher::run();
View
9 lib/Cake/Configure/PhpReader.php
@@ -34,9 +34,12 @@ class PhpReader implements ConfigReaderInterface {
/**
* Constructor for PHP Config file reading.
*
- * @param string $path The path to read config files from. Defaults to CONFIGS
+ * @param string $path The path to read config files from. Defaults to APP . 'Config' . DS
*/
- public function __construct($path = CONFIGS) {
+ public function __construct($path = null) {
+ if (!$path) {
+ $path = APP . 'Config' . DS;
+ }
$this->_path = $path;
}
@@ -81,4 +84,4 @@ public function read($key) {
}
return $config;
}
-}
+}
View
10 lib/Cake/Console/Command/AclShell.php
@@ -20,7 +20,7 @@
App::uses('DbAcl', 'Model');
/**
- * Shell for ACL management. This console is known to have issues with zend.ze1_compatibility_mode
+ * Shell for ACL management. This console is known to have issues with zend.ze1_compatibility_mode
* being enabled. Be sure to turn it off when using this shell.
*
* @package cake.console.libs
@@ -86,7 +86,7 @@ public function startup() {
$this->args = null;
return $this->DbConfig->execute();
}
- require_once (CONFIGS.'database.php');
+ require_once (APP . 'Config' . DS . 'database.php');
if (!in_array($this->command, array('initdb'))) {
$collection = new ComponentCollection();
@@ -348,13 +348,13 @@ public function initdb() {
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
-
+
$type = array(
- 'choices' => array('aro', 'aco'),
+ 'choices' => array('aro', 'aco'),
'required' => true,
'help' => __d('cake_console', 'Type of node to create.')
);
-
+
$parser->description(__d('cake_console', 'A console tool for managing the DbAcl'))
->addSubcommand('create', array(
'help' => __d('cake_console', 'Create a new ACL node'),
View
16 lib/Cake/Console/Command/ApiShell.php
@@ -41,14 +41,14 @@ class ApiShell extends Shell {
*/
public function initialize() {
$this->paths = array_merge($this->paths, array(
- 'behavior' => LIBS . 'Model' . DS . 'Behavior' . DS,
- 'cache' => LIBS . 'Cache' . DS,
- 'controller' => LIBS . 'Controller' . DS,
- 'component' => LIBS . 'Controller' . DS . 'Component' . DS,
- 'helper' => LIBS . 'View' . DS . 'Helper' . DS,
- 'model' => LIBS . 'Model' . DS,
- 'view' => LIBS . 'View' . DS,
- 'core' => LIBS
+ 'behavior' => CAKE . 'Model' . DS . 'Behavior' . DS,
+ 'cache' => CAKE . 'Cache' . DS,
+ 'controller' => CAKE . 'Controller' . DS,
+ 'component' => CAKE . 'Controller' . DS . 'Component' . DS,
+ 'helper' => CAKE . 'View' . DS . 'Helper' . DS,
+ 'model' => CAKE . 'Model' . DS,
+ 'view' => CAKE . 'View' . DS,
+ 'core' => CAKE
));
}
View
2  lib/Cake/Console/Command/ConsoleShell.php
@@ -339,7 +339,7 @@ protected function _loadRoutes() {
Router::reload();
extract(Router::getNamedExpressions());
- if (!@include(CONFIGS . 'routes.php')) {
+ if (!@include(APP . 'Config' . DS . 'routes.php')) {
return false;
}
Router::parse('/');
View
2  lib/Cake/Console/Command/SchemaShell.php
@@ -440,7 +440,7 @@ public function getOptionParser() {
);
$path = array(
'help' => __d('cake_console', 'Path to read and write schema.php'),
- 'default' => CONFIGS . 'Schema'
+ 'default' => APP . 'Config' . 'Schema'
);
$file = array(
'help' => __d('cake_console', 'File name to read and write.'),
View
5 lib/Cake/Console/Command/Task/ControllerTask.php
@@ -36,18 +36,19 @@ class ControllerTask extends BakeTask {
public $tasks = array('Model', 'Test', 'Template', 'DbConfig', 'Project');
/**
- * path to CONTROLLERS directory
+ * path to Controller directory
*
* @var array
* @access public
*/
- public $path = CONTROLLERS;
+ public $path = null;
/**
* Override initialize
*
*/
public function initialize() {
+ $this->path = current(App::path('Controller'));
}
/**
View
12 lib/Cake/Console/Command/Task/ModelTask.php
@@ -30,12 +30,12 @@
class ModelTask extends BakeTask {
/**
- * path to MODELS directory
+ * path to Model directory
*
* @var string
* @access public
*/
- public $path = MODELS;
+ public $path = null;
/**
* tasks
@@ -70,6 +70,14 @@ class ModelTask extends BakeTask {
protected $_validations = array();
/**
+ * Override initialize
+ *
+ */
+ public function initialize() {
+ $this->path = current(App::path('Model'));
+ }
+
+/**
* Execution method always used for tasks
*
*/
View
8 lib/Cake/Console/Command/Task/PluginTask.php
@@ -28,7 +28,7 @@
class PluginTask extends Shell {
/**
- * path to CONTROLLERS directory
+ * path to plugins directory
*
* @var array
* @access public
@@ -41,7 +41,7 @@ class PluginTask extends Shell {
* @return void
*/
function initialize() {
- $this->path = APP . 'Plugin' . DS;
+ $this->path = current(App::path('plugins'));
}
/**
@@ -94,7 +94,7 @@ public function bake($plugin) {
$this->findPath($pathOptions);
}
$this->hr();
- $this->out(__d('cake_console', "<info>Plugin Name:</info> %s", $plugin));
+ $this->out(__d('cake_console', "<info>Plugin Name:</info> %s", $plugin));
$this->out(__d('cake_console', "<info>Plugin Directory:</info> %s", $this->path . $pluginPath));
$this->hr();
@@ -184,7 +184,7 @@ public function findPath($pathOptions) {
*/
public function getOptionParser() {
$parser = parent::getOptionParser();
- return $parser->description(__d('cake_console',
+ return $parser->description(__d('cake_console',
'Create the directory structure, AppModel and AppController classes for a new plugin. ' .
'Can create plugins in any of your bootstrapped plugin paths.'
))->addArgument('name', array(
View
12 lib/Cake/Console/Command/Task/ProjectTask.php
@@ -82,14 +82,14 @@ public function execute() {
if ($this->securitySalt($path) === true) {
$this->out(__d('cake_console', ' * Random hash key created for \'Security.salt\''));
} else {
- $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', CONFIGS . 'core.php'));
+ $this->err(__d('cake_console', 'Unable to generate random hash for \'Security.salt\', you should change it in %s', APP . 'Config' . DS . 'core.php'));
$success = false;
}
if ($this->securityCipherSeed($path) === true) {
$this->out(__d('cake_console', ' * Random seed created for \'Security.cipherSeed\''));
} else {
- $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', CONFIGS . 'core.php'));
+ $this->err(__d('cake_console', 'Unable to generate random seed for \'Security.cipherSeed\', you should change it in %s', APP . 'Config' . DS . 'core.php'));
$success = false;
}
@@ -202,7 +202,7 @@ function bake($path, $skel = null, $skip = array('empty')) {
public function createHome($dir) {
$app = basename($dir);
$path = $dir . 'View' . DS . 'pages' . DS;
- $source = LIBS . 'Console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
+ $source = CAKE . 'Console' . DS . 'templates' . DS .'default' . DS . 'views' . DS . 'home.ctp';
include($source);
return $this->createFile($path.'home.ctp', $output);
}
@@ -218,7 +218,7 @@ public function consolePath($path) {
$File = new File($path . 'Console' . DS . 'cake.php');
$contents = $File->read();
if (preg_match('/(__CAKE_PATH__)/', $contents, $match)) {
- $path = LIBS . 'Console' . DS;
+ $path = CAKE . 'Console' . DS;
$replacement = "'" . str_replace(DS, "' . DIRECTORY_SEPARATOR . '", $path) . "'";
$result = str_replace($match[0], $replacement, $contents);
if ($File->write($result)) {
@@ -260,7 +260,7 @@ public function securityCipherSeed($path) {
$contents = $File->read();
if (preg_match('/([\s]*Configure::write\(\'Security.cipherSeed\',[\s\'A-z0-9]*\);)/', $contents, $match)) {
if (!class_exists('Security')) {
- require LIBS . 'Utility' . DS . 'security.php';
+ require CAKE . 'Utility' . DS . 'security.php';
}
$string = substr(bin2hex(Security::generateAuthKey()), 0, 30);
$result = str_replace($match[0], "\t" . 'Configure::write(\'Security.cipherSeed\', \''.$string.'\');', $contents);
@@ -313,7 +313,7 @@ public function corePath($path) {
* @return boolean Success
*/
public function cakeAdmin($name) {
- $path = (empty($this->configPath)) ? CONFIGS : $this->configPath;
+ $path = (empty($this->configPath)) ? APP . 'Config' . DS : $this->configPath;
$File = new File($path . 'core.php');
$contents = $File->read();
if (preg_match('%(\s*[/]*Configure::write\(\'Routing.prefixes\',[\s\'a-z,\)\(]*\);)%', $contents, $match)) {
View
7 lib/Cake/Console/Command/Task/ViewTask.php
@@ -36,12 +36,12 @@ class ViewTask extends BakeTask {
public $tasks = array('Project', 'Controller', 'DbConfig', 'Template');
/**
- * path to VIEWS directory
+ * path to View directory
*
* @var array
* @access public
*/
- public $path = VIEWS;
+ public $path = null;
/**
* Name of the controller being used
@@ -89,6 +89,7 @@ class ViewTask extends BakeTask {
*
*/
public function initialize() {
+ $this->path = current(App::path('View'));
}
/**
@@ -407,7 +408,7 @@ public function getTemplate($action) {
}
if (!empty($this->template) && $action != $this->template) {
return $this->template;
- }
+ }
$template = $action;
$prefixes = Configure::read('Routing.prefixes');
foreach ((array)$prefixes as $prefix) {
View
87 lib/Cake/Console/Command/UpgradeShell.php
@@ -339,6 +339,89 @@ public function configure() {
}
/**
+ * constants
+ *
+ * @access public
+ * @return void
+ */
+ public function constants() {
+ $this->_paths = array(
+ APP
+ );
+ if (!empty($this->params['plugin'])) {
+ $this->_paths = array(App::pluginPath($this->params['plugin']));
+ }
+ $patterns = array(
+ array(
+ "LIBS -> CAKE",
+ '/\bLIBS\b/',
+ 'CAKE'
+ ),
+ array(
+ "CONFIGS -> APP . 'Config' . DS",
+ '/\bCONFIGS\b/',
+ 'APP . \'Config\' . DS'
+ ),
+ array(
+ "CONTROLLERS -> APP . 'Controller' . DS",
+ '/\bCONTROLLERS\b/',
+ 'APP . \'Controller\' . DS'
+ ),
+ array(
+ "COMPONENTS -> APP . 'Controller' . DS . 'Component' . DS",
+ '/\bCOMPONENTS\b/',
+ 'APP . \'Controller\' . DS . \'Component\''
+ ),
+ array(
+ "MODELS -> APP . 'Model' . DS",
+ '/\bMODELS\b/',
+ 'APP . \'Model\' . DS'
+ ),
+ array(
+ "BEHAVIORS -> APP . 'Model' . DS . 'Behavior' . DS",
+ '/\bBEHAVIORS\b/',
+ 'APP . \'Model\' . DS . \'Behavior\' . DS'
+ ),
+ array(
+ "VIEWS -> APP . 'View' . DS",
+ '/\bVIEWS\b/',
+ 'APP . \'View\' . DS'
+ ),
+ array(
+ "HELPERS -> APP . 'View' . DS . 'Helper' . DS",
+ '/\bHELPERS\b/',
+ 'APP . \'View\' . DS . \'Helper\' . DS'
+ ),
+ array(
+ "LAYOUTS -> APP . 'View' . DS . 'Layouts' . DS",
+ '/\bLAYOUTS\b/',
+ 'APP . \'View\' . DS . \'Layouts\' . DS'
+ ),
+ array(
+ "ELEMENTS -> APP . 'View' . DS . 'Elements' . DS",
+ '/\bELEMENTS\b/',
+ 'APP . \'View\' . DS . \'Elements\' . DS'
+ ),
+ array(
+ "CONSOLE_LIBS -> CAKE . 'Console' . DS",
+ '/\bCONSOLE_LIBS\b/',
+ 'CAKE . \'Console\' . DS'
+ ),
+ array(
+ "CAKE_TESTS_LIB -> CAKE . 'TestSuite' . DS",
+ '/\bCAKE_TESTS_LIB\b/',
+ 'CAKE . \'TestSuite\' . DS'
+ ),
+ array(
+ "CAKE_TESTS -> CAKE . 'Test' . DS",
+ '/\bCAKE_TESTS\b/',
+ 'CAKE . \'Test\' . DS'
+ )
+ );
+ $this->_filesRegexpUpdate($patterns);
+ }
+
+/**
* Move application php files to where they now should be
*
* Find all php files in the folder (honoring recursive) and determine where cake expects the file to be
@@ -549,6 +632,10 @@ function getOptionParser() {
->addSubcommand('configure', array(
'help' => "Update Configure::read() to Configure::read('debug')",
'parser' => $subcommandParser
+ ))
+ ->addSubcommand('constants', array(
+ 'help' => "Replace Obsolete constants",
+ 'parser' => $subcommandParser
));
}
}
View
2  lib/Cake/Console/ShellDispatcher.php
@@ -136,7 +136,7 @@ function __bootstrap() {
include_once CAKE_CORE_INCLUDE_PATH . DS . 'Cake' . DS . 'Console' . DS . 'templates' . DS . 'skel' . DS . 'Config' . DS . 'core.php';
App::build();
}
- require_once CONSOLE_LIBS . 'ConsoleErrorHandler.php';
+ require_once CAKE . 'Console' . DS . 'ConsoleErrorHandler.php';
set_exception_handler(array('ConsoleErrorHandler', 'handleException'));
set_error_handler(array('ConsoleErrorHandler', 'handleError'), Configure::read('Error.level'));
View
4 lib/Cake/Console/templates/default/views/home.ctp
@@ -37,7 +37,7 @@ endif;
<p>
<?php
\$filePresent = null;
- if (file_exists(CONFIGS . 'database.php')):
+ if (file_exists(APP . 'Config' . DS . 'database.php')):
echo '<span class=\"notice success\">';
echo __('Your database configuration file is present.');
\$filePresent = true;
@@ -93,4 +93,4 @@ $output .= "\t\tYou can also add some CSS styles for your pages at: %s',\n";
$output .= "\t\tAPP . 'View' . DS . 'Pages' . DS . 'home.ctp.<br />', APP . 'View' . DS . 'Layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');\n";
$output .= "?>\n";
$output .= "</p>\n";
-?>
+?>
View
2  lib/Cake/Console/templates/skel/webroot/test.php
@@ -75,6 +75,6 @@
die(__('Debug setting does not allow access to this url.'));
}
-require_once CAKE_TESTS_LIB . 'CakeTestSuiteDispatcher.php';
+require_once CAKE . 'TestSuite' . DS . 'CakeTestSuiteDispatcher.php';
CakeTestSuiteDispatcher::run();
View
24 lib/Cake/Controller/Component/AclComponent.php
@@ -238,8 +238,8 @@ public function initialize($component);
}
/**
- * DbAcl implements an ACL control system in the database. ARO's and ACO's are
- * structured into trees and a linking table is used to define permissions. You
+ * DbAcl implements an ACL control system in the database. ARO's and ACO's are
+ * structured into trees and a linking table is used to define permissions. You
* can install the schema for DbAcl with the Schema Shell.
*
* `$aco` and `$aro` parameters can be slash delimited paths to tree nodes.
@@ -515,7 +515,7 @@ protected function _getAcoKeys($keys) {
}
/**
- * IniAcl implements an access control system using an INI file. An example
+ * IniAcl implements an access control system using an INI file. An example
* of the ini file used can be found in /config/acl.ini.php.
*
* @package cake.libs.model.iniacl
@@ -542,11 +542,11 @@ class IniAcl extends Object implements AclInterface {
/**
* Initialize method
*
- * @param AclBase $component
+ * @param AclBase $component
* @return void
*/
public function initialize($component) {
-
+
}
/**
@@ -558,7 +558,7 @@ public function initialize($component) {
* @return boolean Success
*/
public function allow($aro, $aco, $action = "*") {
-
+
}
/**
@@ -570,7 +570,7 @@ public function allow($aro, $aco, $action = "*") {
* @return boolean Success
*/
public function deny($aro, $aco, $action = "*") {
-
+
}
/**
@@ -582,12 +582,12 @@ public function deny($aro, $aco, $action = "*") {
* @return boolean Success
*/
public function inherit($aro, $aco, $action = "*") {
-
+
}
/**
- * Main ACL check function. Checks to see if the ARO (access request object) has access to the
- * ACO (access control object).Looks at the acl.ini.php file for permissions
+ * Main ACL check function. Checks to see if the ARO (access request object) has access to the
+ * ACO (access control object).Looks at the acl.ini.php file for permissions
* (see instructions in /config/acl.ini.php).
*
* @param string $aro ARO
@@ -597,10 +597,10 @@ public function inherit($aro, $aco, $action = "*") {
*/
public function check($aro, $aco, $aco_action = null) {
if ($this->config == null) {
- $this->config = $this->readConfigFile(CONFIGS . 'acl.ini.php');
+ $this->config = $this->readConfigFile(APP . 'Config' . DS . 'acl.ini.php');
}
$aclConfig = $this->config;
-
+
if (is_array($aro)) {
$aro = Set::classicExtract($aro, $this->userPath);
}
View
6 lib/Cake/Core/App.php
@@ -411,7 +411,7 @@ public static function themePath($theme) {
* @return string full path to package
*/
public static function core($type) {
- return array(LIBS . str_replace('/', DS, $type) . DS);
+ return array(CAKE . str_replace('/', DS, $type) . DS);
}
/**
@@ -563,7 +563,7 @@ public static function load($className) {
if (empty($plugin)) {
$appLibs = empty(self::$__packages['Lib']) ? APPLIBS : current(self::$__packages['Lib']);
$paths[] = $appLibs . $package . DS;
- $paths[] = LIBS . $package . DS;
+ $paths[] = CAKE . $package . DS;
}
foreach ($paths as $path) {
@@ -845,4 +845,4 @@ public static function shutdown() {
Cache::write('object_map', self::$__objects, '_cake_core_');
}
}
-}
+}
View
16 lib/Cake/Core/Configure.php
@@ -69,14 +69,14 @@ public static function bootstrap($boot = true) {
'www_root' => WWW_ROOT
));
- if (!include(CONFIGS . 'core.php')) {
- trigger_error(__d('cake_dev', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
+ if (!include(APP . 'Config' . DS . 'core.php')) {
+ trigger_error(__d('cake_dev', "Can't find application core file. Please create %score.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR);
}
App::init();
App::build();
- if (!include(CONFIGS . 'bootstrap.php')) {
- trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", CONFIGS), E_USER_ERROR);
+ if (!include(APP . 'Config' . DS . 'bootstrap.php')) {
+ trigger_error(__d('cake_dev', "Can't find application bootstrap file. Please create %sbootstrap.php, and make sure it is readable by PHP.", APP . 'Config' . DS), E_USER_ERROR);
}
$level = -1;
if (isset(self::$_values['Error']['level'])) {
@@ -295,7 +295,7 @@ public static function load($key, $config = 'default', $merge = true) {
return false;
}
$values = self::$_readers[$config]->read($key);
-
+
if ($merge) {
$keys = array_keys($values);
foreach ($keys as $key) {
@@ -304,7 +304,7 @@ public static function load($key, $config = 'default', $merge = true) {
}
}
}
-
+
return self::write($values);
}
@@ -318,7 +318,7 @@ public static function load($key, $config = 'default', $merge = true) {
*/
public static function version() {
if (!isset(self::$_values['Cake']['version'])) {
- require(LIBS . 'Config' . DS . 'config.php');
+ require(CAKE . 'Config' . DS . 'config.php');
self::write($config);
}
return self::$_values['Cake']['version'];
@@ -373,4 +373,4 @@ public static function restore($name, $cacheConfig = 'default') {
* @return array An array of data to merge into the runtime configuration
*/
function read($key);
-}
+}
View
10 lib/Cake/Core/Object.php
@@ -74,7 +74,7 @@ public function requestAction($url, $extra = array()) {
$extra['url'] = array();
}
$extra = array_merge(array('autoRender' => 0, 'return' => 1, 'bare' => 1, 'requested' => 1), $extra);
-
+
if (is_string($url)) {
$request = new CakeRequest($url);
} elseif (is_array($url)) {
@@ -119,7 +119,7 @@ public function dispatchMethod($method, $params = array()) {
}
/**
- * Stop execution of the current script. Wraps exit() making
+ * Stop execution of the current script. Wraps exit() making
* testing easier.
*
* @param $status see http://php.net/exit for values
@@ -139,7 +139,7 @@ protected function _stop($status = 0) {
*/
public function log($msg, $type = LOG_ERROR) {
if (!class_exists('CakeLog')) {
- require LIBS . 'cake_log.php';
+ require CAKE . 'cake_log.php';
}
if (!is_string($msg)) {
$msg = print_r($msg, true);
@@ -148,7 +148,7 @@ public function log($msg, $type = LOG_ERROR) {
}
/**
- * Allows setting of multiple properties of the object in a single line of code. Will only set
+ * Allows setting of multiple properties of the object in a single line of code. Will only set
* properties that are part of a class declaration.
*
* @param array $properties An associative array containing properties and corresponding values.
@@ -213,7 +213,7 @@ protected function _mergeVars($properties, $class, $normalize = true) {
foreach ($properties as $var) {
if (
isset($classProperties[$var]) &&
- !empty($classProperties[$var]) &&
+ !empty($classProperties[$var]) &&
is_array($this->{$var}) &&
$this->{$var} != $classProperties[$var]
) {
View
2  lib/Cake/Model/Behavior/AclBehavior.php
@@ -49,7 +49,7 @@ public function setup($model, $config = array()) {
$types = $this->__typeMaps[$this->settings[$model->name]['type']];
if (!class_exists('AclNode')) {
- require LIBS . 'model' . DS . 'db_acl.php';
+ require CAKE . 'model' . DS . 'db_acl.php';
}
if (!is_array($types)) {
$types = array($types);
View
4 lib/Cake/Model/CakeSchema.php
@@ -94,7 +94,7 @@ function __construct($options = array()) {
}
if (empty($options['path'])) {
- $this->path = CONFIGS . 'Schema';
+ $this->path = APP . 'Config' . 'Schema';
}
$options = array_merge(get_object_vars($this), $options);
@@ -277,7 +277,7 @@ public function read($options = array()) {
if (in_array($withTable, $currentTables)) {
$key = array_search($withTable, $currentTables);
$noPrefixWith = str_replace($prefix, '', $withTable);
-
+
$tables[$noPrefixWith] = $this->__columns($Object->$class);
$tables[$noPrefixWith]['indexes'] = $db->index($Object->$class);
$tables[$noPrefixWith]['tableParameters'] = $db->readTableParameters($withTable);
View
4 lib/Cake/Model/ConnectionManager.php
@@ -65,7 +65,7 @@ class ConnectionManager {
*
*/
private static function init() {
- include_once CONFIGS . 'database.php';
+ include_once APP . 'Config' . DS . 'database.php';
if (class_exists('DATABASE_CONFIG')) {
self::$config = new DATABASE_CONFIG();
}
@@ -265,4 +265,4 @@ public static function shutdown() {
session_write_close();
}
}
-}
+}
View
12 lib/Cake/Network/Email/CakeEmail.php
@@ -46,7 +46,7 @@ class CakeEmail {
const LINE_LENGTH_SHOULD = 78;
/**
- * Line length - no must more - RFC 2822 - 2.1.1
+ * Line length - no must more - RFC 2822 - 2.1.1
*
* @constant LINE_LENGTH_MUST
*/
@@ -890,7 +890,7 @@ public function config($config = null) {
public function send($content = null) {
if (is_string($this->_config)) {
if (!config('email')) {
- throw new SocketException(__d('cake', '%s not found.', CONFIGS . 'email.php'));
+ throw new SocketException(__d('cake', '%s not found.', APP . 'Config' . 'email.php'));
}
$configs = new EmailConfig();
if (!isset($configs->{$this->_config})) {
@@ -971,7 +971,7 @@ public static function deliver($to = null, $subject = null, $message = null, $tr
if (is_string($transportConfig)) {
if (!config('email')) {
- throw new SocketException(__d('cake', '%s not found.', CONFIGS . 'email.php'));
+ throw new SocketException(__d('cake', '%s not found.', APP . 'Config' . 'email.php'));
}
$configs = new EmailConfig();
if (!isset($configs->{$transportConfig})) {
@@ -1276,7 +1276,7 @@ protected function _render($content) {
$msg[] = 'Content-Transfer-Encoding: 7bit';
$msg[] = '';
- $View->viewPath = $View->layoutPath = 'emails' . DS . 'text';
+ $View->viewPath = $View->layoutPath = 'Emails' . DS . 'text';
$View->viewVars['content'] = $originalContent;
$this->_textMessage = str_replace(array("\r\n", "\r"), "\n", $View->render($this->_template, $this->_layout));
$content = explode("\n", $this->_textMessage);
@@ -1288,7 +1288,7 @@ protected function _render($content) {
$msg[] = 'Content-Transfer-Encoding: 7bit';
$msg[] = '';
- $View->viewPath = $View->layoutPath = 'emails' . DS . 'html';
+ $View->viewPath = $View->layoutPath = 'Emails' . DS . 'html';
$View->viewVars['content'] = $originalContent;
$View->hasRendered = false;
$this->_htmlMessage = str_replace(array("\r\n", "\r"), "\n", $View->render($this->_template, $this->_layout));
@@ -1317,7 +1317,7 @@ protected function _render($content) {
}
}
- $View->viewPath = $View->layoutPath = 'emails' . DS . $this->_emailFormat;
+ $View->viewPath = $View->layoutPath = 'Emails' . DS . $this->_emailFormat;
$View->viewVars['content'] = $content;
$rendered = $View->render($this->_template, $this->_layout);
$content = explode("\n", $rendered);
View
10 lib/Cake/Routing/Dispatcher.php
@@ -33,7 +33,7 @@
/**
* Dispatcher converts Requests into controller actions. It uses the dispatched Request
- * to locate and load the correct controller. If found, the requested action is called on
+ * to locate and load the correct controller. If found, the requested action is called on
* the controller.
*
* @package cake
@@ -64,7 +64,7 @@ public function __construct($url = null, $base = false) {
* to autoRender, via Controller::$autoRender, then Dispatcher will render the view.
*
* Actions in CakePHP can be any public method on a controller, that is not declared in Controller. If you
- * want controller methods to be public and in-accesible by URL, then prefix them with a `_`.
+ * want controller methods to be public and in-accesible by URL, then prefix them with a `_`.
* For example `public function _loadPosts() { }` would not be accessible via URL. Private and protected methods
* are also not accessible via URL.
*
@@ -103,7 +103,7 @@ public function dispatch(CakeRequest $request, $additionalParams = array()) {
}
/**
- * Check if the request's action is marked as private, with an underscore, of if the request is attempting to
+ * Check if the request's action is marked as private, with an underscore, of if the request is attempting to
* directly accessing a prefixed action.
*
* @param CakeRequest $request The request to check
@@ -236,7 +236,7 @@ protected function _loadController($request) {
* @return void
*/
protected function _loadRoutes() {
- include CONFIGS . 'routes.php';
+ include APP . 'Config' . DS . 'routes.php';
}
/**
@@ -278,7 +278,7 @@ public function asset($url) {
}
$filters = Configure::read('Asset.filter');
$isCss = (
- strpos($url, 'ccss/') === 0 ||
+ strpos($url, 'ccss/') === 0 ||
preg_match('#^(theme/([^/]+)/ccss/)|(([^/]+)(?<!css)/ccss)/#i', $url)
);
$isJs = (
View
6 lib/Cake/Test/Case/BasicsTest.php
@@ -34,7 +34,7 @@ class BasicsTest extends CakeTestCase {
*/
public function setUp() {
App::build(array(
- 'locales' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
+ 'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
));
$this->_language = Configure::read('Config.language');
}
@@ -206,7 +206,7 @@ public function testH() {
$string = '<foo> & &nbsp;';
$result = h($string, false);
$this->assertEqual('&lt;foo&gt; &amp; &nbsp;', $result);
-
+
$string = '<foo> & &nbsp;';
$result = h($string, 'UTF-8');
$this->assertEqual('&lt;foo&gt; &amp; &amp;nbsp;', $result);
@@ -226,7 +226,7 @@ public function testH() {
'&nbsp;'
);
$this->assertEqual($expected, $result);
-
+
$arr = array('f' => '<foo>', 'n' => '&nbsp;');
$result = h($arr, false);
$expected = array(
View
16 lib/Cake/Test/Case/Cache/CacheTest.php
@@ -89,8 +89,8 @@ function testNonFatalErrorsWithCachedisable() {
*/
function testConfigWithLibAndPluginEngines() {
App::build(array(
- 'Lib' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), true);
CakePlugin::load('TestPlugin');
@@ -252,8 +252,8 @@ function testInitSettings() {
*/
function testDrop() {
App::build(array(
- 'libs' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), true);
$result = Cache::drop('some_config_that_does_not_exist');
@@ -305,10 +305,10 @@ function testWriteEmptyValues() {
*/
function testWriteTriggerError() {
App::build(array(
- 'libs' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), true);
-
+
Cache::config('test_trigger', array('engine' => 'TestAppCache', 'prefix' => ''));
try {
Cache::write('fail', 'value', 'test_trigger');
@@ -400,7 +400,7 @@ function testSetOnAlternateConfigs() {
Cache::config('file_config', array('engine' => 'File', 'prefix' => 'test_file_'));
Cache::set(array('duration' => '+1 year'), 'file_config');
$settings = Cache::settings('file_config');
-
+
$this->assertEquals('test_file_', $settings['prefix']);
$this->assertEquals(strtotime('+1 year') - time(), $settings['duration']);
}
View
4 lib/Cake/Test/Case/Configure/IniReaderTest.php
@@ -34,7 +34,7 @@ class IniReaderTest extends CakeTestCase {
*/
function setup() {
parent::setup();
- $this->path = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
+ $this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
}
/**
@@ -125,4 +125,4 @@ public function testReadingWithoutExtension() {
$config = $reader->read('nested');
$this->assertTrue($config['bools']['test_on']);
}
-}
+}
View
4 lib/Cake/Test/Case/Configure/PhpReaderTest.php
@@ -26,7 +26,7 @@ class PhpReaderTest extends CakeTestCase {
*/
function setUp() {
parent::setUp();
- $this->path = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
+ $this->path = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS;
}
/**
* test reading files
@@ -83,7 +83,7 @@ function testReadWithDots() {
*/
function testReadPluginValue() {
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), true);
CakePlugin::load('TestPlugin');
$reader = new PhpReader($this->path);
View
2  lib/Cake/Test/Case/Console/Command/ApiShellTest.php
@@ -82,7 +82,7 @@ public function testMethodNameDetection () {
$this->Shell->expects($this->at(2))->method('out')->with($expected);
$this->Shell->args = array('controller');
- $this->Shell->paths['controller'] = LIBS . 'Controller' . DS;
+ $this->Shell->paths['controller'] = CAKE . 'Controller' . DS;
$this->Shell->main();
}
}
View
6 lib/Cake/Test/Case/Console/Command/CommandListShellTest.php
@@ -41,10 +41,10 @@ public function setUp() {
parent::setUp();
App::build(array(
'plugins' => array(
- LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
+ CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
),
'Console/Command' => array(
- LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
+ CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
), true);
CakePlugin::loadAll();
@@ -130,7 +130,7 @@ function testSortPlugin() {
$expected = "/\[.*TestPlugin.*\]\n[ ]+example/";
$this->assertPattern($expected, $output);
-
+
$expected = "/\[.*Core.*\]\n[ ]+acl, api, bake, command_list, console, i18n, schema, testsuite/";
$this->assertPattern($expected, $output);
}
View
22 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
@@ -97,7 +97,7 @@ class SchemaShellTest extends CakeTestCase {
* @var array
* @access public
*/
- public $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author',
+ public $fixtures = array('core.article', 'core.user', 'core.post', 'core.auth_user', 'core.author',
'core.comment', 'core.test_plugin_comment'
);
@@ -187,7 +187,7 @@ public function testView() {
*/
public function testViewWithPlugins() {
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->args = array('TestPlugin.schema');
@@ -238,7 +238,7 @@ public function testDumpWithFileWriting() {
*/
public function testDumpFileWritingWithPlugins() {
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->args = array('TestPlugin.TestPluginApp');
@@ -314,7 +314,7 @@ public function testGenerateOverwrite() {
$this->Shell->expects($this->at(2))->method('out')
->with(new PHPUnit_Framework_Constraint_PCREMatch('/Schema file:\s[a-z\.]+\sgenerated/'));
-
+
$this->Shell->Schema = $this->getMock('CakeSchema');
$this->Shell->Schema->path = TMP;
$this->Shell->Schema->expects($this->once())->method('read')->will($this->returnValue(array('schema data')));
@@ -336,7 +336,7 @@ public function testGenerateOverwrite() {
*/
public function testGenerateWithPlugins() {
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), true);
CakePlugin::load('TestPlugin');
@@ -377,7 +377,7 @@ public function testCreateNoArgs() {
$this->Shell->create();
$db = ConnectionManager::getDataSource('test');
-
+
$db->cacheSources = false;
$sources = $db->listSources();
$this->assertTrue(in_array($db->config['prefix'] . 'i18n', $sources));
@@ -400,7 +400,7 @@ public function testCreateWithTableArgs() {
$this->Shell->params = array(
'connection' => 'test',
'name' => 'DbAcl',
- 'path' => CONFIGS . 'schema'
+ 'path' => APP . 'Config' . DS . 'schema'
);
$this->Shell->args = array('DbAcl', 'acos');
$this->Shell->startup();
@@ -439,7 +439,7 @@ public function testUpdateWithTable() {
$this->Shell->expects($this->any())->method('in')->will($this->returnValue('y'));
$this->Shell->expects($this->once())->method('__run')
->with($this->arrayHasKey('articles'), 'update', $this->isInstanceOf('CakeSchema'));
-
+
$this->Shell->update();
}
@@ -450,7 +450,7 @@ public function testUpdateWithTable() {
*/
public function testPluginParam() {
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->params = array(
@@ -458,7 +458,7 @@ public function testPluginParam() {
'connection' => 'test'
);
$this->Shell->startup();
- $expected = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Config' . DS . 'Schema';
+ $expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS . 'Config' . DS . 'Schema';
$this->assertEqual($this->Shell->Schema->path, $expected);
CakePlugin::unload();
}
@@ -470,7 +470,7 @@ public function testPluginParam() {
*/
public function testPluginDotSyntaxWithCreate() {
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->params = array(
View
30 lib/Cake/Test/Case/Console/Command/ShellTest.php
@@ -57,17 +57,17 @@ protected function _stop($status = 0) {
}
public function do_something() {
-
+
}
-
+
public function _secret() {
-
+
}
-
+
protected function no_access() {
-
+
}
-
+
public function mergeVars($properties, $class, $normalize = true) {
return $this->_mergeVars($properties, $class, $normalize);
}
@@ -169,8 +169,8 @@ function testMergeVars() {
*/
public function testInitialize() {
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
- 'models' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
+ 'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
), true);
$this->Shell->uses = array('TestPlugin.TestPluginPost');
@@ -408,7 +408,7 @@ public function testError() {
*
* @return void
*/
- public function testLoadTasks() {
+ public function testLoadTasks() {
$this->assertTrue($this->Shell->loadTasks());
$this->Shell->tasks = null;
@@ -451,9 +451,9 @@ function test__getArgAndParamReferences() {
$this->Shell->params = array('help' => false);
$this->Shell->loadTasks();
$result = $this->Shell->TestApple;
-
+
$this->Shell->args = array('one', 'two');
-
+
$this->assertSame($this->Shell->args, $result->args);
$this->assertSame($this->Shell->params, $result->params);
}
@@ -546,7 +546,7 @@ function testCreateFileInteractive() {
$this->Shell->stdin->expects($this->at(0))
->method('read')
->will($this->returnValue('n'));
-
+
$this->Shell->stdin->expects($this->at(1))
->method('read')
->will($this->returnValue('y'));
@@ -651,11 +651,11 @@ function testCreateFileWindowsInteractive() {
function testHasTask() {
$this->Shell->tasks = array('Extract', 'DbConfig');
$this->Shell->loadTasks();
-
+
$this->assertTrue($this->Shell->hasTask('extract'));
$this->assertTrue($this->Shell->hasTask('Extract'));
$this->assertFalse($this->Shell->hasTask('random'));
-
+
$this->assertTrue($this->Shell->hasTask('db_config'));
$this->assertTrue($this->Shell->hasTask('DbConfig'));
}
@@ -749,7 +749,7 @@ function testRunCommandTriggeringHelp() {
->with(array('--help'))
->will($this->returnValue(array(array('help' => true), array())));
$Parser->expects($this->once())->method('help');
-
+
$Shell = $this->getMock('Shell', array('getOptionParser', 'out', 'startup', '_welcome'), array(), '', false);
$Shell->expects($this->once())->method('getOptionParser')
->will($this->returnValue($Parser));
View
18 lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php
@@ -70,7 +70,7 @@ public function tearDown() {
public function testExecute() {
$this->Task->interactive = false;
- $this->Task->params['paths'] = LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages';
+ $this->Task->params['paths'] = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages';
$this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->any())->method('in')
@@ -117,7 +117,7 @@ public function testExecute() {
$pattern = '/To change its layout, create: APP\/views\/layouts\/default\.ctp\./s';
$this->assertPattern($pattern, $result);
-
+
// extract.ctp
$pattern = '/\#: (\\\\|\/)extract\.ctp:6\n';
$pattern .= 'msgid "You have %d new message."\nmsgid_plural "You have %d new messages."/';
@@ -131,7 +131,7 @@ public function testExecute() {
$pattern .= '\#: (\\\\|\/)home\.ctp:99\n';
$pattern .= 'msgid "Editing this Page"\nmsgstr ""/';
$this->assertPattern($pattern, $result);
-
+
$pattern = '/\#: (\\\\|\/)extract\.ctp:17\nmsgid "';
$pattern .= 'Hot features!';
$pattern .= '\\\n - No Configuration: Set-up the database and let the magic begin';
@@ -162,7 +162,7 @@ public function testExecute() {
function testExtractWithExclude() {
$this->Task->interactive = false;
- $this->Task->params['paths'] = LIBS . 'Test' . DS . 'test_app' . DS . 'View';
+ $this->Task->params['paths'] = CAKE . 'Test' . DS . 'test_app' . DS . 'View';
$this->Task->params['output'] = $this->path . DS;
$this->Task->params['exclude'] = 'Pages,Layouts';
@@ -175,7 +175,7 @@ function testExtractWithExclude() {
$pattern = '/\#: .*extract\.ctp:6\n/';
$this->assertNotRegExp($pattern, $result);
-
+
$pattern = '/\#: .*default\.ctp:26\n/';
$this->assertNotRegExp($pattern, $result);
}
@@ -188,10 +188,10 @@ function testExtractWithExclude() {
function testExtractMultiplePaths() {
$this->Task->interactive = false;
- $this->Task->params['paths'] =
- LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages,' .
- LIBS . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts';
-
+ $this->Task->params['paths'] =
+ CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Pages,' .
+ CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS . 'Posts';
+
$this->Task->params['output'] = $this->path . DS;
$this->Task->expects($this->never())->method('err');
$this->Task->expects($this->never())->method('_stop');
View
28 lib/Cake/Test/Case/Console/Command/Task/ProjectTaskTest.php
@@ -43,8 +43,8 @@ public function setUp() {
parent::setUp();
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
-
- $this->Task = $this->getMock('ProjectTask',
+
+ $this->Task = $this->getMock('ProjectTask',
array('in', 'err', 'createFile', '_stop'),
array($out, $out, $in)
);
@@ -70,7 +70,7 @@ public function tearDown() {
* @return void
*/
protected function _setupTestProject() {
- $skel = LIBS . 'Console' . DS . 'templates' . DS . 'skel';
+ $skel = CAKE . 'Console' . DS . 'templates' . DS . 'skel';
$this->Task->expects($this->at(0))->method('in')->will($this->returnValue('y'));
$this->Task->bake($this->Task->path . 'bake_test_app', $skel);
}
@@ -91,12 +91,12 @@ public function testBake() {
'Console',
'Console' . DS . 'Command',
'Console' . DS . 'Command' . DS . 'Task',
- 'Controller',
- 'Model',
+ 'Controller',
+ 'Model',
'View',
'View' . DS . 'Helper',
'Test',
- 'Test' . DS . 'Case',
+ 'Test' . DS . 'Case',
'Test' . DS . 'Case' . DS . 'Model',
'Test' . DS . 'Fixture',
'tmp',
@@ -118,21 +118,21 @@ public function testBakeEmptyFlag() {
$this->Task->params['empty'] = true;
$this->_setupTestProject();
$path = $this->Task->path . 'bake_test_app';
-
+
$empty = array(
'Console' . DS . 'Command' . DS . 'Task',
- 'Controller' . DS . 'Component',
- 'Model' . DS . 'Behavior',
+ 'Controller' . DS . 'Component',
+ 'Model' . DS . 'Behavior',
'View' . DS . 'Helper',
'View' . DS . 'Errors',
'View' . DS . 'Scaffolds',
- 'Test' . DS . 'Case' . DS . 'Model',
+ 'Test' . DS . 'Case' . DS . 'Model',
'Test' . DS . 'Case' . DS . 'Controller',
'Test' . DS . 'Case' . DS . 'View' . DS . 'Helper',
'Test' . DS . 'Fixture',
'webroot' . DS . 'js'
);
-
+
foreach ($empty as $dir) {
$this->assertTrue(is_file($path . DS . $dir . DS . 'empty'), 'Missing empty file in ' . $dir);
}
@@ -220,7 +220,7 @@ public function testGetPrefix() {
* @return void
*/
public function testCakeAdmin() {
- $file = new File(CONFIGS . 'core.php');
+ $file = new File(APP . 'Config' . DS . 'core.php');
$contents = $file->read();;
$file = new File(TMP . 'tests' . DS . 'core.php');
$file->write($contents);
@@ -255,7 +255,7 @@ public function testGetPrefixWithMultiplePrefixes() {
* @return void
*/
public function testExecute() {
- $this->Task->params['skel'] = LIBS . 'Console' . DS. 'templates' . DS . 'skel';
+ $this->Task->params['skel'] = CAKE . 'Console' . DS. 'templates' . DS . 'skel';
$this->Task->params['working'] = TMP . 'tests' . DS;
$path = $this->Task->path . 'bake_test_app';
@@ -281,7 +281,7 @@ public function testExecute() {
*/
function testConsolePath() {
$this->_setupTestProject();
-
+
$path = $this->Task->path . 'bake_test_app' . DS;
$result = $this->Task->consolePath($path);
$this->assertTrue($result);
View
12 lib/Cake/Test/Case/Console/Command/Task/TemplateTaskTest.php
@@ -42,7 +42,7 @@ public function setup() {
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
- $this->Task = $this->getMock('TemplateTask',
+ $this->Task = $this->getMock('TemplateTask',
array('in', 'err', 'createFile', '_stop', 'clear'),
array($out, $out, $in)
);
@@ -73,7 +73,7 @@ public function testSet() {
$this->assertEqual($this->Task->templateVars['one'], 'three');
$this->assertTrue(isset($this->Task->templateVars['four']));
$this->assertEqual($this->Task->templateVars['four'], 'five');
-
+
$this->Task->templateVars = array();
$this->Task->set(array(3 => 'three', 4 => 'four'));
$this->Task->set(array(1 => 'one', 2 => 'two'));
@@ -87,7 +87,7 @@ public function testSet() {
* @return void
*/
public function testFindingInstalledThemesForBake() {
- $consoleLibs = LIBS . 'Console' . DS;
+ $consoleLibs = CAKE . 'Console' . DS;
$this->Task->initialize();
$this->assertEqual($this->Task->templatePaths['default'], $consoleLibs . 'templates' . DS . 'default' . DS);
}
@@ -99,7 +99,7 @@ public function testFindingInstalledThemesForBake() {
* @return void
*/
public function testGetThemePath() {
- $defaultTheme = LIBS . dirname(CONSOLE_LIBS) . 'templates' . DS . 'default' .DS;
+ $defaultTheme = CAKE . 'Console' . DS . 'templates' . DS . 'default' .DS;
$this->Task->templatePaths = array('default' => $defaultTheme);
$this->Task->expects($this->exactly(1))->method('in')->will($this->returnValue('1'));
@@ -126,7 +126,7 @@ public function testGetThemePath() {
public function testGenerate() {
App::build(array(
'Console' => array(
- LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS
+ CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS
)
));
$this->Task->initialize();
@@ -146,7 +146,7 @@ public function testGenerate() {
public function testGenerateWithTemplateFallbacks() {
App::build(array(
'Console' => array(
- LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS,
+ CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS,
CAKE_CORE_INCLUDE_PATH . DS . 'console' . DS
)
));
View
10 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
@@ -242,7 +242,7 @@ public function setup() {
$out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
- $this->Task = $this->getMock('TestTask',
+ $this->Task = $this->getMock('TestTask',
array('in', 'err', 'createFile', '_stop', 'isLoadableClass'),
array($out, $out, $in)
);
@@ -542,7 +542,7 @@ public function testBakeWithPlugin() {
* @return void
*/
function testInteractiveWithPlugin() {
- $testApp = LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS;
+ $testApp = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS;
App::build(array(
'plugins' => array($testApp)
), true);
@@ -555,8 +555,8 @@ function testInteractiveWithPlugin() {
->will($this->onConsecutiveCalls(
5, //helper
1 //OtherHelper
- ));
-
+ ));
+
$this->Task->expects($this->once())
->method('createFile')
->with($path, $this->anything());
@@ -564,7 +564,7 @@ function testInteractiveWithPlugin() {
$this->Task->stdout->expects($this->at(21))
->method('write')
->with('1. OtherHelperHelper');
-
+
$this->Task->execute();
}
View
4 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
@@ -117,10 +117,10 @@ public function setUp() {
parent::setUp();
App::build(array(
'plugins' => array(
- LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
+ CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
),
'Console/Command' => array(
- LIBS . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
+ CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
), true);
CakePlugin::loadAll();
View
4 lib/Cake/Test/Case/Console/TaskCollectionTest.php
@@ -88,7 +88,7 @@ function testLoadPluginTask() {
$dispatcher = $this->getMock('ShellDispatcher', array(), array(), '', false);
$shell = $this->getMock('Shell', array(), array(), '', false);
App::build(array(
- 'plugins' => array(LIBS . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Tasks = new TaskCollection($shell, $dispatcher);
@@ -119,4 +119,4 @@ function testUnload() {
$this->assertEquals(array('Extract'), $result, 'loaded tasks is wrong');
}
-}
+}
View
8 lib/Cake/Test/Case/Controller/Component/AclComponentTest.php
@@ -16,7 +16,7 @@
* @since CakePHP(tm) v 1.2.0.5435
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
-
+
App::uses('AclComponent', 'Controller/Component');
App::uses('AclNode', 'Model');
class_exists('AclComponent');
@@ -210,7 +210,7 @@ function tearDown() {
}
/**
- * test that construtor throws an exception when Acl.classname is a
+ * test that construtor throws an exception when Acl.classname is a
* non-existant class
*
* @expectedException CakeException
@@ -262,7 +262,7 @@ class IniAclTest extends CakeTestCase {
* @return void
*/
function testCheck() {
- $iniFile = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
+ $iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
$Ini = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile);
@@ -285,7 +285,7 @@ function testCheck() {
* @return void
*/
function testCheckArray() {
- $iniFile = LIBS . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
+ $iniFile = CAKE . 'Test' . DS . 'test_app' . DS . 'Config'. DS . 'acl.ini.php';
$Ini = new IniAcl();
$Ini->config = $Ini->readConfigFile($iniFile);
View
14 lib/Cake/Test/Case/Controller/Component/Auth/BasicAuthenticateTest.php
@@ -21,7 +21,7 @@
App::uses('CakeResponse', 'Network');
-require_once CAKE_TESTS . 'Case' . DS . 'Model' . DS . 'models.php';
+require_once CAKE . 'Test' . DS . 'Case' . DS . 'Model' . DS . 'models.php';
/**
* Test case for BasicAuthentication