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

This commit is contained in:
Kyle Robinson Young 2012-02-18 04:04:54 -08:00
parent 6684b775cd
commit c4829dc3b8
26 changed files with 42 additions and 40 deletions

View file

@ -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 {

View file

@ -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');

View file

@ -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();

View file

@ -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;

View file

@ -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';

View file

@ -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');
}

View file

@ -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');

View file

@ -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');

View file

@ -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');

View file

@ -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';

View file

@ -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);
}

View file

@ -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');

View file

@ -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(

View file

@ -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!');

View file

@ -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);

View file

@ -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'));
}

View file

@ -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(

View file

@ -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(

View file

@ -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);

View file

@ -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';

View file

@ -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');

View file

@ -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);
}
/**

View file

@ -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());

View file

@ -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());

View file

@ -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());

View file

@ -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'));