Load specific test plugins rather than all to avoid conflicts

This commit is contained in:
Kyle Robinson Young 2012-02-16 19:59:24 -08:00
parent a9c279aab0
commit 4141a3ab5b
14 changed files with 24 additions and 27 deletions

View file

@ -47,7 +47,7 @@ class CommandListShellTest extends CakeTestCase {
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
), true);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$out = new TestStringOutput();
$in = $this->getMock('ConsoleInput', array(), array(), '', false);

View file

@ -120,7 +120,7 @@ class ShellDispatcherTest extends CakeTestCase {
CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS
)
), true);
CakePlugin::loadAll();
CakePlugin::load('TestPlugin');
}
/**

View file

@ -370,7 +370,7 @@ class AppTest extends CakeTestCase {
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), App::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$result = App::objects('TestPlugin.model');
$this->assertTrue(in_array('TestPluginPost', $result));
@ -419,7 +419,7 @@ class AppTest extends CakeTestCase {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$path = App::pluginPath('TestPlugin');
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS . 'TestPlugin' . DS;
@ -540,7 +540,7 @@ class AppTest extends CakeTestCase {
'Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$result = App::import('Controller', 'TestPlugin.Tests');
$this->assertTrue($result);
@ -715,7 +715,7 @@ class AppTest extends CakeTestCase {
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
'vendors' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
), App::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
ob_start();
$result = App::import('Vendor', 'css/TestAsset', array('ext' => 'css'));
@ -772,7 +772,7 @@ class AppTest extends CakeTestCase {
'libs' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS),
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), App::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$this->assertFalse(class_exists('CustomLibClass', false));
App::uses('CustomLibClass', 'TestPlugin.Custom/Package');
@ -815,7 +815,7 @@ class AppTest extends CakeTestCase {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), App::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$this->assertFalse(class_exists('TestPluginOtherLibrary', false));
App::uses('TestPluginOtherLibrary', 'TestPlugin.Lib');
$this->assertTrue(class_exists('TestPluginOtherLibrary'));

View file

@ -530,7 +530,7 @@ class ObjectTest extends CakeTestCase {
'controllers' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS),
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'. DS)
), true);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));
$result = $this->object->requestAction(
array('controller' => 'request_action', 'action' => 'test_request_action')

View file

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

View file

@ -275,7 +275,7 @@ class ConnectionManagerTest extends CakeTestCase {
CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS
)
), App::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$expected = array(
'datasource' => 'Test2Source'
);

View file

@ -1039,7 +1039,7 @@ class DispatcherTest extends CakeTestCase {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), true);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$Dispatcher = new TestDispatcher();
$Dispatcher->base = false;
@ -1115,7 +1115,7 @@ class DispatcherTest extends CakeTestCase {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), APP::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
Router::reload();
Router::parse('/');
@ -1176,7 +1176,7 @@ class DispatcherTest extends CakeTestCase {
'vendors' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$Dispatcher = new TestDispatcher();
$response = $this->getMock('CakeResponse', array('_sendHeader'));
@ -1294,7 +1294,7 @@ class DispatcherTest extends CakeTestCase {
'Vendor' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Vendor'. DS),
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'PluginJs'));
$Dispatcher = new TestDispatcher();
$response = $this->getMock('CakeResponse', array('_sendHeader'));

View file

@ -1188,7 +1188,7 @@ class RouterTest extends CakeTestCase {
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
)
), true);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));
Router::reload();
require CAKE . 'Config' . DS . 'routes.php';
@ -2202,7 +2202,7 @@ class RouterTest extends CakeTestCase {
CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS
)
), true);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'PluginJs'));
Router::reload();
require CAKE . 'Config' . DS . 'routes.php';

View file

@ -125,7 +125,7 @@ class ControllerTestCaseTest extends CakeTestCase {
'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS),
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)
), App::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
$this->Case = $this->getMockForAbstractClass('ControllerTestCase');
Router::reload();
}

View file

@ -31,7 +31,7 @@ class HtmlCoverageReportTest extends CakeTestCase {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)
), App::RESET);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));
$reporter = new CakeBaseReporter();
$reporter->params = array('app' => false, 'plugin' => false, 'group' => false);
$coverage = array();

View file

@ -85,7 +85,7 @@ class HelperCollectionTest extends CakeTestCase {
$this->assertInstanceOf('HtmlAliasHelper', $result);
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));
$result = $this->Helpers->load('SomeOther', array('className' => 'TestPlugin.OtherHelper'));
$this->assertInstanceOf('OtherHelperHelper', $result);
$this->assertInstanceOf('OtherHelperHelper', $this->Helpers->SomeOther);
@ -127,7 +127,7 @@ class HelperCollectionTest extends CakeTestCase {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));
$result = $this->Helpers->load('TestPlugin.OtherHelper');
$this->assertInstanceOf('OtherHelperHelper', $result, 'Helper class is wrong.');
$this->assertInstanceOf('OtherHelperHelper', $this->Helpers->OtherHelper, 'Class is wrong');

View file

@ -649,7 +649,7 @@ class HelperTest extends CakeTestCase {
App::build(array(
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS),
));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));;
$result = $this->Helper->assetTimestamp('/test_plugin/css/test_plugin_asset.css');
$this->assertRegExp('#/test_plugin/css/test_plugin_asset.css\?[0-9]+$#', $result, 'Missing timestamp plugin');
@ -888,7 +888,7 @@ class HelperTest extends CakeTestCase {
App::build(array(
'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS),
));
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));
$Helper = new TestHelper($this->View);
$this->assertInstanceOf('OtherHelperHelper', $Helper->OtherHelper);
$this->assertInstanceOf('HtmlHelper', $Helper->Html);

View file

@ -115,7 +115,7 @@ class ThemeViewTest extends CakeTestCase {
'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View'. DS)
));
App::objects('plugins', null, false);
CakePlugin::loadAll();
CakePlugin::load(array('TestPlugin'));
}
/**

View file

@ -276,9 +276,6 @@ class ViewTest extends CakeTestCase {
CakePlugin::load(array('TestPlugin', 'TestPlugin', 'PluginJs'));
Configure::write('debug', 2);
CakePlugin::loadAll();
}
/**