ソースを参照

Use App::RESET instead of true with App::build()

Kyle Robinson Young 14 年 前
コミット
c4829dc3b8
26 ファイル変更42 行追加40 行削除
  1. 3 3
      lib/Cake/Test/Case/Cache/CacheTest.php
  2. 1 1
      lib/Cake/Test/Case/Configure/PhpReaderTest.php
  3. 1 1
      lib/Cake/Test/Case/Console/Command/CommandListShellTest.php
  4. 1 1
      lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
  5. 1 1
      lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
  6. 1 1
      lib/Cake/Test/Case/Console/ShellDispatcherTest.php
  7. 1 1
      lib/Cake/Test/Case/Console/ShellTest.php
  8. 1 1
      lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php
  9. 2 2
      lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php
  10. 1 1
      lib/Cake/Test/Case/Controller/ControllerTest.php
  11. 1 1
      lib/Cake/Test/Case/Core/CakePluginTest.php
  12. 3 1
      lib/Cake/Test/Case/Core/ConfigureTest.php
  13. 3 3
      lib/Cake/Test/Case/Core/ObjectTest.php
  14. 2 2
      lib/Cake/Test/Case/Error/ErrorHandlerTest.php
  15. 1 1
      lib/Cake/Test/Case/Error/ExceptionRendererTest.php
  16. 1 1
      lib/Cake/Test/Case/I18n/I18nTest.php
  17. 1 1
      lib/Cake/Test/Case/Log/CakeLogTest.php
  18. 2 2
      lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
  19. 3 3
      lib/Cake/Test/Case/Routing/DispatcherTest.php
  20. 2 2
      lib/Cake/Test/Case/Routing/RouterTest.php
  21. 2 2
      lib/Cake/Test/Case/Utility/CakeTimeTest.php
  22. 1 1
      lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
  23. 2 2
      lib/Cake/Test/Case/View/Helper/NumberHelperTest.php
  24. 2 2
      lib/Cake/Test/Case/View/Helper/TextHelperTest.php
  25. 2 2
      lib/Cake/Test/Case/View/Helper/TimeHelperTest.php
  26. 1 1
      lib/Cake/Test/Case/View/ViewTest.php

+ 3 - 3
lib/Cake/Test/Case/Cache/CacheTest.php

@@ -88,7 +88,7 @@ class CacheTest extends CakeTestCase {
 		App::build(array(
 			'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 
 		$settings = array('engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_');
@@ -260,7 +260,7 @@ class CacheTest extends CakeTestCase {
 		App::build(array(
 			'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 
 		$result = Cache::drop('some_config_that_does_not_exist');
 		$this->assertFalse($result);
@@ -312,7 +312,7 @@ class CacheTest extends CakeTestCase {
 		App::build(array(
 			'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 
 		Cache::config('test_trigger', array('engine' => 'TestAppCache', 'prefix' => ''));
 		try {

+ 1 - 1
lib/Cake/Test/Case/Configure/PhpReaderTest.php

@@ -85,7 +85,7 @@ class PhpReaderTest extends CakeTestCase {
 	public function testReadPluginValue() {
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 		$reader = new PhpReader($this->path);
 		$result = $reader->read('TestPlugin.load');

+ 1 - 1
lib/Cake/Test/Case/Console/Command/CommandListShellTest.php

@@ -46,7 +46,7 @@ class CommandListShellTest extends CakeTestCase {
 			'Console/Command' => array(
 				CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
 			)
-		), true);
+		), App::RESET);
 		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
 
 		$out = new TestStringOutput();

+ 1 - 1
lib/Cake/Test/Case/Console/Command/SchemaShellTest.php

@@ -336,7 +336,7 @@ class SchemaShellTest extends CakeTestCase {
 	public function testGenerateWithPlugins() {
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 
 		$this->db->cacheSources = false;

+ 1 - 1
lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php

@@ -573,7 +573,7 @@ class TestTaskTest extends CakeTestCase {
 		$testApp = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS;
 		App::build(array(
 			'plugins' => array($testApp)
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 
 		$this->Task->plugin = 'TestPlugin';

+ 1 - 1
lib/Cake/Test/Case/Console/ShellDispatcherTest.php

@@ -119,7 +119,7 @@ class ShellDispatcherTest extends CakeTestCase {
 			'Console/Command' => array(
 				CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
 			)
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 	}
 

+ 1 - 1
lib/Cake/Test/Case/Console/ShellTest.php

@@ -173,7 +173,7 @@ class ShellTest extends CakeTestCase {
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
 			'models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS)
-		), true);
+		), App::RESET);
 
 		CakePlugin::load('TestPlugin');
 		$this->Shell->uses = array('TestPlugin.TestPluginPost');

+ 1 - 1
lib/Cake/Test/Case/Controller/Component/Auth/FormAuthenticateTest.php

@@ -160,7 +160,7 @@ class FormAuthenticateTest extends CakeTestCase {
 		Cache::delete('object_map', '_cake_core_');
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 
 		$ts = date('Y-m-d H:i:s');

+ 2 - 2
lib/Cake/Test/Case/Controller/Component/RequestHandlerComponentTest.php

@@ -712,7 +712,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
 	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 @@ class RequestHandlerComponentTest extends CakeTestCase {
 	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');

+ 1 - 1
lib/Cake/Test/Case/Controller/ControllerTest.php

@@ -624,7 +624,7 @@ class ControllerTest extends CakeTestCase {
 	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';

+ 1 - 1
lib/Cake/Test/Case/Core/CakePluginTest.php

@@ -33,7 +33,7 @@ class CakePluginTest extends CakeTestCase {
 	public function setUp() {
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		App::objects('plugins', null, false);
 	}
 

+ 3 - 1
lib/Cake/Test/Case/Core/ConfigureTest.php

@@ -255,7 +255,9 @@ class ConfigureTest extends CakeTestCase {
  * @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');

+ 3 - 3
lib/Cake/Test/Case/Core/ObjectTest.php

@@ -449,7 +449,7 @@ class ObjectTest extends CakeTestCase {
 			'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);
+		), App::RESET);
 		$this->assertNull(Router::getRequest(), 'request stack should be empty.');
 
 		$result = $this->object->requestAction('');
@@ -489,7 +489,7 @@ class ObjectTest extends CakeTestCase {
 	public function testRequestActionPlugins() {
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 		Router::reload();
 
@@ -529,7 +529,7 @@ class ObjectTest extends CakeTestCase {
 			'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);
+		), App::RESET);
 		CakePlugin::load(array('TestPlugin'));
 
 		$result = $this->object->requestAction(

+ 2 - 2
lib/Cake/Test/Case/Error/ErrorHandlerTest.php

@@ -41,7 +41,7 @@ class ErrorHandlerTest extends CakeTestCase {
 			'View' => array(
 				CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
 			)
-		), true);
+		), App::RESET);
 		Router::reload();
 
 		$request = new CakeRequest(null, false);
@@ -232,7 +232,7 @@ class ErrorHandlerTest extends CakeTestCase {
 			'plugins' => 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!');

+ 1 - 1
lib/Cake/Test/Case/Error/ExceptionRendererTest.php

@@ -155,7 +155,7 @@ class ExceptionRendererTest extends CakeTestCase {
 			'views' => array(
 				CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
 			)
-		), true);
+		), App::RESET);
 		Router::reload();
 
 		$request = new CakeRequest(null, false);

+ 1 - 1
lib/Cake/Test/Case/I18n/I18nTest.php

@@ -35,7 +35,7 @@ class I18nTest extends CakeTestCase {
 		App::build(array(
 			'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS),
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		CakePlugin::load(array('TestPlugin'));
 	}
 

+ 1 - 1
lib/Cake/Test/Case/Log/CakeLogTest.php

@@ -49,7 +49,7 @@ class CakeLogTest extends CakeTestCase {
 		App::build(array(
 			'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 
 		$result = CakeLog::config('libtest', array(

+ 2 - 2
lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php

@@ -504,7 +504,7 @@ class CakeSessionTest extends CakeTestCase {
 				CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS . 'Session' . DS
 			),
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		Configure::write('Session', array(
 			'defaults' => 'cake',
 			'handler' => array(
@@ -525,7 +525,7 @@ class CakeSessionTest extends CakeTestCase {
 	public function testUsingPluginHandler() {
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		CakePlugin::load('TestPlugin');
 
 		Configure::write('Session', array(

+ 3 - 3
lib/Cake/Test/Case/Routing/DispatcherTest.php

@@ -1038,7 +1038,7 @@ class DispatcherTest extends CakeTestCase {
 		Router::reload();
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), true);
+		), App::RESET);
 		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
 
 		$Dispatcher = new TestDispatcher();
@@ -1114,7 +1114,7 @@ class DispatcherTest extends CakeTestCase {
 		$Dispatcher = new TestDispatcher();
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-		), APP::RESET);
+		), App::RESET);
 		CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
 		Router::reload();
 		Router::parse('/');
@@ -1396,7 +1396,7 @@ class DispatcherTest extends CakeTestCase {
 
 		App::build(array(
 			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
-		), true);
+		), App::RESET);
 
 		$dispatcher = new TestDispatcher();
 		$request = new CakeRequest($url);

+ 2 - 2
lib/Cake/Test/Case/Routing/RouterTest.php

@@ -1187,7 +1187,7 @@ class RouterTest extends CakeTestCase {
 			'plugins' =>  array(
 				CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
 			)
-		), true);
+		), App::RESET);
 		CakePlugin::load(array('TestPlugin'));
 
 		Router::reload();
@@ -2201,7 +2201,7 @@ class RouterTest extends CakeTestCase {
 			'plugins' =>  array(
 				CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
 			)
-		), true);
+		), App::RESET);
 		CakePlugin::load(array('TestPlugin', 'PluginJs'));
 		Router::reload();
 		require CAKE . 'Config' . DS . 'routes.php';

+ 2 - 2
lib/Cake/Test/Case/Utility/CakeTimeTest.php

@@ -656,7 +656,7 @@ class CakeTimeTest extends CakeTestCase {
 	public function testConvertSpecifiers() {
 		App::build(array(
 			'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
-		), true);
+		), App::RESET);
 		Configure::write('Config.language', 'time_test');
 		$time = strtotime('Thu Jan 14 11:43:39 2010');
 
@@ -763,7 +763,7 @@ class CakeTimeTest extends CakeTestCase {
 	public function testI18nFormat() {
 		App::build(array(
 			'locales' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS)
-		), true);
+		), App::RESET);
 		Configure::write('Config.language', 'time_test');
 
 		$time = strtotime('Thu Jan 14 13:59:28 2010');

+ 1 - 1
lib/Cake/Test/Case/View/Helper/CacheHelperTest.php

@@ -85,7 +85,7 @@ class CacheHelperTest extends CakeTestCase {
 		Configure::write('Cache.disable', false);
 		App::build(array(
 			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
-		), true);
+		), App::RESET);
 	}
 
 /**

+ 2 - 2
lib/Cake/Test/Case/View/Helper/NumberHelperTest.php

@@ -92,13 +92,13 @@ class NumberHelperTest extends CakeTestCase {
 	public function testEngineOverride() {
 		App::build(array(
 			'Utility' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Utility' . DS)
-			), APP::REGISTER);
+		), App::REGISTER);
 		$Number = new NumberHelperTestObject($this->View, array('engine' => 'TestAppEngine'));
 		$this->assertInstanceOf('TestAppEngine', $Number->engine());
 
 		App::build(array(
 			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-			));
+		));
 		CakePlugin::load('TestPlugin');
 		$Number = new NumberHelperTestObject($this->View, array('engine' => 'TestPlugin.TestPluginEngine'));
 		$this->assertInstanceOf('TestPluginEngine', $Number->engine());

+ 2 - 2
lib/Cake/Test/Case/View/Helper/TextHelperTest.php

@@ -88,13 +88,13 @@ class TextHelperTest extends CakeTestCase {
 	public function testEngineOverride() {
 		App::build(array(
 			'Utility' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Utility' . DS)
-			), APP::REGISTER);
+		), App::REGISTER);
 		$Text = new TextHelperTestObject($this->View, array('engine' => 'TestAppEngine'));
 		$this->assertInstanceOf('TestAppEngine', $Text->engine());
 
 		App::build(array(
 			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-			));
+		));
 		CakePlugin::load('TestPlugin');
 		$Text = new TextHelperTestObject($this->View, array('engine' => 'TestPlugin.TestPluginEngine'));
 		$this->assertInstanceOf('TestPluginEngine', $Text->engine());

+ 2 - 2
lib/Cake/Test/Case/View/Helper/TimeHelperTest.php

@@ -98,13 +98,13 @@ class TimeHelperTest extends CakeTestCase {
 	public function testEngineOverride() {
 		App::build(array(
 			'Utility' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Utility' . DS)
-			), APP::REGISTER);
+		), App::REGISTER);
 		$Time = new TimeHelperTestObject($this->View, array('engine' => 'TestAppEngine'));
 		$this->assertInstanceOf('TestAppEngine', $Time->engine());
 
 		App::build(array(
 			'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
-			));
+		));
 		CakePlugin::load('TestPlugin');
 		$Time = new TimeHelperTestObject($this->View, array('engine' => 'TestPlugin.TestPluginEngine'));
 		$this->assertInstanceOf('TestPluginEngine', $Time->engine());

+ 1 - 1
lib/Cake/Test/Case/View/ViewTest.php

@@ -271,7 +271,7 @@ class ViewTest extends CakeTestCase {
 		App::build(array(
 			'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
 			'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
-		), true);
+		), App::RESET);
 		App::objects('plugins', null, false);
 
 		CakePlugin::load(array('TestPlugin', 'TestPlugin', 'PluginJs'));