Skip to content

Commit

Permalink
Use App::RESET instead of true with App::build()
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Feb 18, 2012
1 parent 6684b77 commit c4829dc
Show file tree
Hide file tree
Showing 26 changed files with 42 additions and 40 deletions.
6 changes: 3 additions & 3 deletions lib/Cake/Test/Case/Cache/CacheTest.php
Expand Up @@ -88,7 +88,7 @@ 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);
), App::RESET);
CakePlugin::load('TestPlugin');

$settings = array('engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_');
Expand Down Expand Up @@ -260,7 +260,7 @@ 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);
), App::RESET);

$result = Cache::drop('some_config_that_does_not_exist');
$this->assertFalse($result);
Expand Down Expand Up @@ -312,7 +312,7 @@ 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);
), App::RESET);

Cache::config('test_trigger', array('engine' => 'TestAppCache', 'prefix' => ''));
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Configure/PhpReaderTest.php
Expand Up @@ -85,7 +85,7 @@ public function testReadWithDots() {
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');
Expand Down
Expand Up @@ -46,7 +46,7 @@ public function setUp() {
'Console/Command' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
), true);
), App::RESET);
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));

$out = new TestStringOutput();
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Console/Command/SchemaShellTest.php
Expand Up @@ -336,7 +336,7 @@ public function testGenerateOverwrite() {
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;
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Console/Command/Task/TestTaskTest.php
Expand Up @@ -573,7 +573,7 @@ public function testInteractiveWithPlugin() {
$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';
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Console/ShellDispatcherTest.php
Expand Up @@ -119,7 +119,7 @@ public function setUp() {
'Console/Command' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
), true);
), App::RESET);
CakePlugin::load('TestPlugin');
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Console/ShellTest.php
Expand Up @@ -173,7 +173,7 @@ 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);
), App::RESET);

CakePlugin::load('TestPlugin');
$this->Shell->uses = array('TestPlugin.TestPluginPost');
Expand Down
Expand Up @@ -160,7 +160,7 @@ public function testPluginModel() {
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');
Expand Down
Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Controller/ControllerTest.php
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Core/CakePluginTest.php
Expand Up @@ -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);
}

Expand Down
4 changes: 3 additions & 1 deletion lib/Cake/Test/Case/Core/ConfigureTest.php
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Test/Case/Core/ObjectTest.php
Expand Up @@ -449,7 +449,7 @@ public function testRequestAction() {
'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('');
Expand Down Expand Up @@ -489,7 +489,7 @@ public function testRequestAction() {
public function testRequestActionPlugins() {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
), true);
), App::RESET);
CakePlugin::load('TestPlugin');
Router::reload();

Expand Down Expand Up @@ -529,7 +529,7 @@ public function testRequestActionArray() {
'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(
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Error/ErrorHandlerTest.php
Expand Up @@ -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);
Expand Down Expand Up @@ -232,7 +232,7 @@ public function testLoadPluginHanlder() {
'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!');
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Error/ExceptionRendererTest.php
Expand Up @@ -155,7 +155,7 @@ public function setUp() {
'views' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS
)
), true);
), App::RESET);
Router::reload();

$request = new CakeRequest(null, false);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/I18n/I18nTest.php
Expand Up @@ -35,7 +35,7 @@ public function setUp() {
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'));
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Log/CakeLogTest.php
Expand Up @@ -49,7 +49,7 @@ public function testImportingLoggers() {
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(
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Model/Datasource/CakeSessionTest.php
Expand Up @@ -504,7 +504,7 @@ public function testUsingAppLibsHandler() {
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(
Expand All @@ -525,7 +525,7 @@ public function testUsingAppLibsHandler() {
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(
Expand Down
6 changes: 3 additions & 3 deletions lib/Cake/Test/Case/Routing/DispatcherTest.php
Expand Up @@ -1038,7 +1038,7 @@ public function testPluginShortCutUrlsWithControllerThatNeedsToBeLoaded() {
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();
Expand Down Expand Up @@ -1114,7 +1114,7 @@ public function testTestPluginDispatch() {
$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('/');
Expand Down Expand Up @@ -1396,7 +1396,7 @@ public function testFullPageCachingDispatch($url) {

App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
), true);
), App::RESET);

$dispatcher = new TestDispatcher();
$request = new CakeRequest($url);
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Routing/RouterTest.php
Expand Up @@ -1187,7 +1187,7 @@ public function testPrefixRoutingAndPlugins() {
'plugins' => array(
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
)
), true);
), App::RESET);
CakePlugin::load(array('TestPlugin'));

Router::reload();
Expand Down Expand Up @@ -2201,7 +2201,7 @@ public function testConnectDefaultRoutes() {
'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';
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/Utility/CakeTimeTest.php
Expand Up @@ -656,7 +656,7 @@ public function testFromString() {
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');

Expand Down Expand Up @@ -763,7 +763,7 @@ public function testConvertPercentE() {
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');
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/View/Helper/CacheHelperTest.php
Expand Up @@ -85,7 +85,7 @@ public function setUp() {
Configure::write('Cache.disable', false);
App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
), true);
), App::RESET);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/View/Helper/NumberHelperTest.php
Expand Up @@ -92,13 +92,13 @@ public function testNumberHelperProxyMethodCalls() {
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());
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/View/Helper/TextHelperTest.php
Expand Up @@ -88,13 +88,13 @@ public function testTextHelperProxyMethodCalls() {
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());
Expand Down
4 changes: 2 additions & 2 deletions lib/Cake/Test/Case/View/Helper/TimeHelperTest.php
Expand Up @@ -98,13 +98,13 @@ public function testTimeHelperProxyMethodCalls() {
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());
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/View/ViewTest.php
Expand Up @@ -271,7 +271,7 @@ public function setUp() {
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'));
Expand Down

0 comments on commit c4829dc

Please sign in to comment.