Permalink
Browse files

Merge pull request #508 from shama/patch-app-build

Updates to App::build() uses
  • Loading branch information...
2 parents 8723cf3 + 22582ae commit cee8f2cebb27ba628d2ebc57f6cc7d284bb9e195 @markstory markstory committed Feb 22, 2012
Showing with 123 additions and 121 deletions.
  1. +1 −1 app/Config/bootstrap.php
  2. +1 −1 lib/Cake/Console/Templates/skel/Config/bootstrap.php
  3. +1 −1 lib/Cake/Test/Case/BasicsTest.php
  4. +8 −8 lib/Cake/Test/Case/Cache/CacheTest.php
  5. +2 −2 lib/Cake/Test/Case/Configure/PhpReaderTest.php
  6. +2 −2 lib/Cake/Test/Case/Console/Command/CommandListShellTest.php
  7. +6 −6 lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
  8. +4 −4 lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php
  9. +2 −2 lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
  10. +2 −2 lib/Cake/Test/Case/Console/ShellDispatcherTest.php
  11. +3 −3 lib/Cake/Test/Case/Console/ShellTest.php
  12. +2 −2 lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php
  13. +1 −1 lib/Cake/Test/Case/Controller/Component/EmailComponentTest.php
  14. +2 −2 lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
  15. +2 −2 lib/Cake/Test/Case/Controller/ComponentCollectionTest.php
  16. +1 −1 lib/Cake/Test/Case/Controller/ComponentTest.php
  17. +3 −3 lib/Cake/Test/Case/Controller/ControllerTest.php
  18. +2 −2 lib/Cake/Test/Case/Core/CakePluginTest.php
  19. +3 −1 lib/Cake/Test/Case/Core/ConfigureTest.php
  20. +11 −11 lib/Cake/Test/Case/Core/ObjectTest.php
  21. +3 −3 lib/Cake/Test/Case/Error/ErrorHandlerTest.php
  22. +2 −2 lib/Cake/Test/Case/Error/ExceptionRendererTest.php
  23. +4 −4 lib/Cake/Test/Case/I18n/I18nTest.php
  24. +3 −3 lib/Cake/Test/Case/Log/CakeLogTest.php
  25. +1 −1 lib/Cake/Test/Case/Model/BehaviorCollectionTest.php
  26. +2 −2 lib/Cake/Test/Case/Model/CakeSchemaTest.php
  27. +5 −5 lib/Cake/Test/Case/Model/ConnectionManagerTest.php
  28. +4 −4 lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
  29. +1 −1 lib/Cake/Test/Case/Model/DbAclTest.php
  30. +2 −2 lib/Cake/Test/Case/Network/Email/CakeEmailTest.php
  31. +7 −7 lib/Cake/Test/Case/Routing/DispatcherTest.php
  32. +4 −4 lib/Cake/Test/Case/Routing/RouterTest.php
  33. +1 −1 lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php
  34. +1 −1 lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php
  35. +4 −4 lib/Cake/Test/Case/Utility/CakeTimeTest.php
  36. +1 −1 lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
  37. +1 −1 lib/Cake/Test/Case/View/Helper/FormHelperTest.php
  38. +4 −4 lib/Cake/Test/Case/View/Helper/HtmlHelperTest.php
  39. +2 −2 lib/Cake/Test/Case/View/Helper/NumberHelperTest.php
  40. +2 −2 lib/Cake/Test/Case/View/Helper/TextHelperTest.php
  41. +2 −2 lib/Cake/Test/Case/View/Helper/TimeHelperTest.php
  42. +2 −2 lib/Cake/Test/Case/View/HelperCollectionTest.php
  43. +2 −2 lib/Cake/Test/Case/View/HelperTest.php
  44. +1 −1 lib/Cake/Test/Case/View/ThemeViewTest.php
  45. +3 −3 lib/Cake/Test/Case/View/ViewTest.php
View
@@ -99,7 +99,7 @@
* 'View/Helper' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
* 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
* 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
- * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
+ * 'Locale' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
* ));
*
*/
@@ -40,7 +40,7 @@
* 'View/Helper' => array('/full/path/to/helpers/', '/next/full/path/to/helpers/'),
* 'Vendor' => array('/full/path/to/vendors/', '/next/full/path/to/vendors/'),
* 'Console/Command' => array('/full/path/to/shells/', '/next/full/path/to/shells/'),
- * 'locales' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
+ * 'Locale' => array('/full/path/to/locale/', '/next/full/path/to/locale/')
* ));
*
*/
@@ -35,7 +35,7 @@ class BasicsTest extends CakeTestCase {
*/
public function setUp() {
App::build(array(
- 'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
+ 'Locale' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
));
$this->_language = Configure::read('Config.language');
}
@@ -87,8 +87,8 @@ public function testNonFatalErrorsWithCachedisable() {
public function testConfigWithLibAndPluginEngines() {
App::build(array(
'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
- ), true);
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ ), App::RESET);
CakePlugin::load('TestPlugin');
$settings = array('engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_');
@@ -258,9 +258,9 @@ public function testInitSettings() {
*/
public function testDrop() {
App::build(array(
- 'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
- ), true);
+ 'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ ), App::RESET);
$result = Cache::drop('some_config_that_does_not_exist');
$this->assertFalse($result);
@@ -310,9 +310,9 @@ public function testWriteEmptyValues() {
*/
public function testWriteTriggerError() {
App::build(array(
- 'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
- ), true);
+ 'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ ), App::RESET);
Cache::config('test_trigger', array('engine' => 'TestAppCache', 'prefix' => ''));
try {
@@ -84,8 +84,8 @@ public function testReadWithDots() {
*/
public function testReadPluginValue() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
- ), true);
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ ), App::RESET);
CakePlugin::load('TestPlugin');
$reader = new PhpReader($this->path);
$result = $reader->read('TestPlugin.load');
@@ -40,13 +40,13 @@ class CommandListShellTest extends CakeTestCase {
public function setUp() {
parent::setUp();
App::build(array(
- 'plugins' => array(
+ 'Plugin' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
),
'Console/Command' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
- ), true);
+ ), App::RESET);
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$out = new TestStringOutput();
@@ -182,7 +182,7 @@ public function testView() {
*/
public function testViewWithPlugins() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->args = array('TestPlugin.schema');
@@ -234,7 +234,7 @@ public function testDumpWithFileWriting() {
*/
public function testDumpFileWritingWithPlugins() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->args = array('TestPlugin.TestPluginApp');
@@ -335,8 +335,8 @@ public function testGenerateOverwrite() {
*/
public function testGenerateWithPlugins() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
- ), true);
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ ), App::RESET);
CakePlugin::load('TestPlugin');
$this->db->cacheSources = false;
@@ -450,7 +450,7 @@ public function testUpdateWithTable() {
*/
public function testPluginParam() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->params = array(
@@ -470,7 +470,7 @@ public function testPluginParam() {
*/
public function testPluginDotSyntaxWithCreate() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::load('TestPlugin');
$this->Shell->params = array(
@@ -225,7 +225,7 @@ public function testExtractMultiplePaths() {
*/
public function testExtractExcludePlugins() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
$this->out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$this->in = $this->getMock('ConsoleInput', array(), array(), '', false);
@@ -251,7 +251,7 @@ public function testExtractExcludePlugins() {
*/
public function testExtractPlugin() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
$this->out = $this->getMock('ConsoleOutput', array(), array(), '', false);
@@ -279,7 +279,7 @@ public function testExtractPlugin() {
public function testExtractModelValidation() {
App::build(array(
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), App::RESET);
$this->out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$this->in = $this->getMock('ConsoleInput', array(), array(), '', false);
@@ -366,7 +366,7 @@ public function testExtractModelValidationWithDomainInModel() {
*/
public function testExtractModelValidationInPlugin() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
$this->out = $this->getMock('ConsoleOutput', array(), array(), '', false);
$this->in = $this->getMock('ConsoleInput', array(), array(), '', false);
@@ -572,8 +572,8 @@ public function testBakeWithPlugin() {
public function testInteractiveWithPlugin() {
$testApp = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS;
App::build(array(
- 'plugins' => array($testApp)
- ), true);
+ 'Plugin' => array($testApp)
+ ), App::RESET);
CakePlugin::load('TestPlugin');
$this->Task->plugin = 'TestPlugin';
@@ -113,13 +113,13 @@ class ShellDispatcherTest extends CakeTestCase {
public function setUp() {
parent::setUp();
App::build(array(
- 'plugins' => array(
+ 'Plugin' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
),
'Console/Command' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
- ), true);
+ ), App::RESET);
CakePlugin::load('TestPlugin');
}
@@ -171,9 +171,9 @@ public function testMergeVars() {
*/
public function testInitialize() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
- 'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
- ), true);
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
+ 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
+ ), App::RESET);
CakePlugin::load('TestPlugin');
$this->Shell->uses = array('TestPlugin.TestPluginPost');
@@ -159,8 +159,8 @@ public function testAuthenticateScopeFail() {
public function testPluginModel() {
Cache::delete('object_map', '_cake_core_');
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
- ), true);
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
+ ), App::RESET);
CakePlugin::load('TestPlugin');
$ts = date('Y-m-d H:i:s');
@@ -819,7 +819,7 @@ public function testReset() {
public function testPluginCustomViewClass() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
));
@@ -712,7 +712,7 @@ public function testClientProperties() {
public function testAjaxRedirectAsRequestAction() {
App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
- ), true);
+ ), App::RESET);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
$this->Controller->request = $this->getMock('CakeRequest');
@@ -741,7 +741,7 @@ public function testAjaxRedirectAsRequestAction() {
public function testAjaxRedirectAsRequestActionStillRenderingLayout() {
App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
- ), true);
+ ), App::RESET);
$this->Controller->RequestHandler = $this->getMock('RequestHandlerComponent', array('_stop'), array(&$this->Controller->Components));
$this->Controller->request = $this->getMock('CakeRequest');
@@ -86,7 +86,7 @@ public function testLoadWithAlias() {
$result = $this->Components->load('Cookie');
$this->assertInstanceOf('CookieAliasComponent', $result);
- App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
+ App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
CakePlugin::load('TestPlugin');
$result = $this->Components->load('SomeOther', array('className' => 'TestPlugin.Other'));
$this->assertInstanceOf('OtherComponent', $result);
@@ -128,7 +128,7 @@ public function testLoadMissingComponent() {
*/
public function testLoadPluginComponent() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
));
CakePlugin::load('TestPlugin');
$result = $this->Components->load('TestPlugin.Other');
@@ -219,7 +219,7 @@ class ComponentTest extends CakeTestCase {
public function setUp() {
$this->_pluginPaths = App::path('plugins');
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
}
@@ -460,7 +460,7 @@ public function testLoadModel() {
*/
public function testLoadModelInPlugins() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
));
@@ -501,7 +501,7 @@ public function testConstructClasses() {
unset($Controller);
- App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
+ App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
CakePlugin::load('TestPlugin');
$Controller = new Controller($request);
@@ -624,7 +624,7 @@ public function testControllerSet() {
public function testRender() {
App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
- ), true);
+ ), App::RESET);
ClassRegistry::flush();
$request = new CakeRequest('controller_posts/index');
$request->params['action'] = 'index';
@@ -32,8 +32,8 @@ class CakePluginTest extends CakeTestCase {
*/
public function setUp() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
- ), true);
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ ), App::RESET);
App::objects('plugins', null, false);
}
@@ -255,7 +255,9 @@ public function testLoadNoMerge() {
* @return void
*/
public function testLoadPlugin() {
- App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), true);
+ App::build(array(
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
+ ), App::RESET);
Configure::config('test', new PhpReader());
CakePlugin::load('TestPlugin');
$result = Configure::load('TestPlugin.load', 'test');
@@ -446,10 +446,10 @@ public function testMethodDispatching() {
*/
public function testRequestAction() {
App::build(array(
- 'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
- 'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
- 'controllers' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS)
- ), true);
+ 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
+ 'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS)
+ ), App::RESET);
$this->assertNull(Router::getRequest(), 'request stack should be empty.');
$result = $this->object->requestAction('');
@@ -488,8 +488,8 @@ public function testRequestAction() {
*/
public function testRequestActionPlugins() {
App::build(array(
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
- ), true);
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
+ ), App::RESET);
CakePlugin::load('TestPlugin');
Router::reload();
@@ -525,11 +525,11 @@ public function testRequestActionPlugins() {
*/
public function testRequestActionArray() {
App::build(array(
- 'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
- 'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
- 'controllers' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
- 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS)
- ), true);
+ 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
+ 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
+ 'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
+ 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS)
+ ), App::RESET);
CakePlugin::load(array('TestPlugin'));
$result = $this->object->requestAction(
@@ -41,7 +41,7 @@ public function setUp() {
'View' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
)
- ), true);
+ ), App::RESET);
Router::reload();
$request = new CakeRequest(null, false);
@@ -229,10 +229,10 @@ public function testHandleExceptionLog() {
*/
public function testLoadPluginHanlder() {
App::build(array(
- 'plugins' => array(
+ 'Plugin' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
)
- ), true);
+ ), App::RESET);
CakePlugin::load('TestPlugin');
Configure::write('Exception.renderer', 'TestPlugin.TestPluginExceptionRenderer');
$error = new NotFoundException('Kaboom!');
Oops, something went wrong.

0 comments on commit cee8f2c

Please sign in to comment.