From 4141a3ab5b1cfdfa3b1bb0e988917549130e3d90 Mon Sep 17 00:00:00 2001 From: Kyle Robinson Young Date: Thu, 16 Feb 2012 19:59:24 -0800 Subject: [PATCH] Load specific test plugins rather than all to avoid conflicts --- .../Case/Console/Command/CommandListShellTest.php | 2 +- lib/Cake/Test/Case/Console/ShellDispatcherTest.php | 2 +- lib/Cake/Test/Case/Core/AppTest.php | 12 ++++++------ lib/Cake/Test/Case/Core/ObjectTest.php | 2 +- lib/Cake/Test/Case/I18n/I18nTest.php | 2 +- lib/Cake/Test/Case/Model/ConnectionManagerTest.php | 2 +- lib/Cake/Test/Case/Routing/DispatcherTest.php | 8 ++++---- lib/Cake/Test/Case/Routing/RouterTest.php | 4 ++-- .../Test/Case/TestSuite/ControllerTestCaseTest.php | 2 +- .../Test/Case/TestSuite/HtmlCoverageReportTest.php | 2 +- lib/Cake/Test/Case/View/HelperCollectionTest.php | 4 ++-- lib/Cake/Test/Case/View/HelperTest.php | 4 ++-- lib/Cake/Test/Case/View/ThemeViewTest.php | 2 +- lib/Cake/Test/Case/View/ViewTest.php | 3 --- 14 files changed, 24 insertions(+), 27 deletions(-) diff --git a/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php b/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php index cf51be7f6..688f3655e 100644 --- a/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php +++ b/lib/Cake/Test/Case/Console/Command/CommandListShellTest.php @@ -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); diff --git a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php index 586166632..bbc7ba55c 100644 --- a/lib/Cake/Test/Case/Console/ShellDispatcherTest.php +++ b/lib/Cake/Test/Case/Console/ShellDispatcherTest.php @@ -120,7 +120,7 @@ class ShellDispatcherTest extends CakeTestCase { CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS ) ), true); - CakePlugin::loadAll(); + CakePlugin::load('TestPlugin'); } /** diff --git a/lib/Cake/Test/Case/Core/AppTest.php b/lib/Cake/Test/Case/Core/AppTest.php index 465717bf6..3b25c6082 100644 --- a/lib/Cake/Test/Case/Core/AppTest.php +++ b/lib/Cake/Test/Case/Core/AppTest.php @@ -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')); diff --git a/lib/Cake/Test/Case/Core/ObjectTest.php b/lib/Cake/Test/Case/Core/ObjectTest.php index a6b41beaf..3521b9927 100644 --- a/lib/Cake/Test/Case/Core/ObjectTest.php +++ b/lib/Cake/Test/Case/Core/ObjectTest.php @@ -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') diff --git a/lib/Cake/Test/Case/I18n/I18nTest.php b/lib/Cake/Test/Case/I18n/I18nTest.php index 6eb566903..f2a94b637 100644 --- a/lib/Cake/Test/Case/I18n/I18nTest.php +++ b/lib/Cake/Test/Case/I18n/I18nTest.php @@ -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')); } /** diff --git a/lib/Cake/Test/Case/Model/ConnectionManagerTest.php b/lib/Cake/Test/Case/Model/ConnectionManagerTest.php index bacd89ec4..3311b7ec5 100644 --- a/lib/Cake/Test/Case/Model/ConnectionManagerTest.php +++ b/lib/Cake/Test/Case/Model/ConnectionManagerTest.php @@ -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' ); diff --git a/lib/Cake/Test/Case/Routing/DispatcherTest.php b/lib/Cake/Test/Case/Routing/DispatcherTest.php index 2258c1f7d..1ed8fedb0 100644 --- a/lib/Cake/Test/Case/Routing/DispatcherTest.php +++ b/lib/Cake/Test/Case/Routing/DispatcherTest.php @@ -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')); diff --git a/lib/Cake/Test/Case/Routing/RouterTest.php b/lib/Cake/Test/Case/Routing/RouterTest.php index 25e333c49..c9459cc97 100644 --- a/lib/Cake/Test/Case/Routing/RouterTest.php +++ b/lib/Cake/Test/Case/Routing/RouterTest.php @@ -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'; diff --git a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php index f5139dc4d..f110f18e2 100644 --- a/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php +++ b/lib/Cake/Test/Case/TestSuite/ControllerTestCaseTest.php @@ -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(); } diff --git a/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php b/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php index 4eb4670ca..939c2eda8 100644 --- a/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php +++ b/lib/Cake/Test/Case/TestSuite/HtmlCoverageReportTest.php @@ -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(); diff --git a/lib/Cake/Test/Case/View/HelperCollectionTest.php b/lib/Cake/Test/Case/View/HelperCollectionTest.php index d7f29b29b..694177e13 100644 --- a/lib/Cake/Test/Case/View/HelperCollectionTest.php +++ b/lib/Cake/Test/Case/View/HelperCollectionTest.php @@ -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'); diff --git a/lib/Cake/Test/Case/View/HelperTest.php b/lib/Cake/Test/Case/View/HelperTest.php index 3a474311a..942e986e9 100644 --- a/lib/Cake/Test/Case/View/HelperTest.php +++ b/lib/Cake/Test/Case/View/HelperTest.php @@ -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); diff --git a/lib/Cake/Test/Case/View/ThemeViewTest.php b/lib/Cake/Test/Case/View/ThemeViewTest.php index d8a3d177b..acef6e827 100644 --- a/lib/Cake/Test/Case/View/ThemeViewTest.php +++ b/lib/Cake/Test/Case/View/ThemeViewTest.php @@ -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')); } /** diff --git a/lib/Cake/Test/Case/View/ViewTest.php b/lib/Cake/Test/Case/View/ViewTest.php index 1ea1d70ef..a286e8097 100644 --- a/lib/Cake/Test/Case/View/ViewTest.php +++ b/lib/Cake/Test/Case/View/ViewTest.php @@ -276,9 +276,6 @@ class ViewTest extends CakeTestCase { CakePlugin::load(array('TestPlugin', 'TestPlugin', 'PluginJs')); Configure::write('debug', 2); - - CakePlugin::loadAll(); - } /**