From f9d2db1876504bf82a5d3fd13f95488a1f71c56f Mon Sep 17 00:00:00 2001 From: saeid Date: Fri, 13 Jul 2018 02:03:38 +0430 Subject: [PATCH] change the method to support array only --- src/TestSuite/TestCase.php | 7 ++----- tests/TestCase/Auth/FormAuthenticateTest.php | 2 +- tests/TestCase/Auth/PasswordHasherFactoryTest.php | 2 +- tests/TestCase/Cache/CacheTest.php | 2 +- tests/TestCase/Console/HelperRegistryTest.php | 2 +- tests/TestCase/Console/ShellTest.php | 4 ++-- tests/TestCase/Console/TaskRegistryTest.php | 4 ++-- tests/TestCase/Controller/ComponentRegistryTest.php | 6 +++--- tests/TestCase/Controller/ControllerTest.php | 8 ++++---- tests/TestCase/Core/Configure/Engine/IniConfigTest.php | 2 +- .../TestCase/Core/Configure/Engine/JsonConfigTest.php | 2 +- tests/TestCase/Core/Configure/Engine/PhpConfigTest.php | 2 +- tests/TestCase/Core/ConfigureTest.php | 2 +- tests/TestCase/Datasource/ConnectionManagerTest.php | 2 +- tests/TestCase/Error/ErrorHandlerTest.php | 2 +- tests/TestCase/Error/ExceptionRendererTest.php | 2 +- tests/TestCase/Http/SessionTest.php | 2 +- tests/TestCase/I18n/I18nTest.php | 2 +- tests/TestCase/Log/LogTest.php | 2 +- tests/TestCase/Mailer/EmailTest.php | 2 +- tests/TestCase/ORM/AssociationTest.php | 2 +- tests/TestCase/ORM/BehaviorRegistryTest.php | 8 ++++---- tests/TestCase/ORM/Locator/TableLocatorTest.php | 10 +++++----- tests/TestCase/ORM/QueryRegressionTest.php | 2 +- tests/TestCase/ORM/ResultSetTest.php | 2 +- tests/TestCase/ORM/TableTest.php | 10 +++++----- tests/TestCase/Routing/DispatcherTest.php | 2 +- tests/TestCase/Routing/RequestActionTraitTest.php | 2 +- tests/TestCase/Routing/RouteBuilderTest.php | 4 ++-- tests/TestCase/Routing/RouterTest.php | 4 ++-- tests/TestCase/Shell/Task/AssetsTaskTest.php | 8 ++++---- tests/TestCase/TestSuite/FixtureManagerTest.php | 4 ++-- tests/TestCase/TestSuite/TestCaseTest.php | 2 +- tests/TestCase/View/Helper/FlashHelperTest.php | 4 ++-- tests/TestCase/View/Helper/HtmlHelperTest.php | 10 +++++----- tests/TestCase/View/Helper/NumberHelperTest.php | 2 +- tests/TestCase/View/Helper/TextHelperTest.php | 2 +- tests/TestCase/View/Helper/UrlHelperTest.php | 2 +- tests/TestCase/View/HelperRegistryTest.php | 2 +- tests/TestCase/View/StringTemplateTest.php | 2 +- tests/TestCase/View/Widget/WidgetLocatorTest.php | 2 +- 41 files changed, 71 insertions(+), 74 deletions(-) diff --git a/src/TestSuite/TestCase.php b/src/TestSuite/TestCase.php index 78f2a6ccef0..1026784c5df 100644 --- a/src/TestSuite/TestCase.php +++ b/src/TestSuite/TestCase.php @@ -196,19 +196,16 @@ public function loadFixtures() * Useful to test how plugins being loaded/not loaded interact with other * elements in CakePHP or applications. * - * @param string|array $plugins list of Plugins to load + * @param array $plugins list of Plugins to load * @return \Cake\Http\BaseApplication */ - public function loadPlugins($plugins = []) + public function loadPlugins(array $plugins = []) { $app = $this->getMockForAbstractClass( BaseApplication::class, [''] ); - if (is_string($plugins)) { - $plugins = (array)$plugins; - } foreach ($plugins as $k => $opts) { if (is_array($opts)) { $app->addPlugin($k, $opts); diff --git a/tests/TestCase/Auth/FormAuthenticateTest.php b/tests/TestCase/Auth/FormAuthenticateTest.php index 67e0f4580e2..9e0a0623ee2 100644 --- a/tests/TestCase/Auth/FormAuthenticateTest.php +++ b/tests/TestCase/Auth/FormAuthenticateTest.php @@ -272,7 +272,7 @@ public function testAuthenticateIncludesVirtualFields() */ public function testPluginModel() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $PluginModel = $this->getTableLocator()->get('TestPlugin.AuthUsers'); $user['id'] = 1; diff --git a/tests/TestCase/Auth/PasswordHasherFactoryTest.php b/tests/TestCase/Auth/PasswordHasherFactoryTest.php index f1134ec6d37..3339897118c 100644 --- a/tests/TestCase/Auth/PasswordHasherFactoryTest.php +++ b/tests/TestCase/Auth/PasswordHasherFactoryTest.php @@ -41,7 +41,7 @@ public function testBuild() $this->assertInstanceof('Cake\Auth\DefaultPasswordHasher', $hasher); $this->assertEquals(['foo' => 'bar'], $hasher->getConfig('hashOptions')); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $hasher = PasswordHasherFactory::build('TestPlugin.Legacy'); $this->assertInstanceof('TestPlugin\Auth\LegacyPasswordHasher', $hasher); Plugin::unload(); diff --git a/tests/TestCase/Cache/CacheTest.php b/tests/TestCase/Cache/CacheTest.php index ee13fa15325..03b30291aec 100644 --- a/tests/TestCase/Cache/CacheTest.php +++ b/tests/TestCase/Cache/CacheTest.php @@ -298,7 +298,7 @@ public function testConfigFailedInit() public function testConfigWithLibAndPluginEngines() { static::setAppNamespace(); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $config = ['engine' => 'TestAppCache', 'path' => TMP, 'prefix' => 'cake_test_']; Cache::setConfig('libEngine', $config); diff --git a/tests/TestCase/Console/HelperRegistryTest.php b/tests/TestCase/Console/HelperRegistryTest.php index c12c366b443..625322fee9f 100644 --- a/tests/TestCase/Console/HelperRegistryTest.php +++ b/tests/TestCase/Console/HelperRegistryTest.php @@ -112,7 +112,7 @@ public function testLoadMissingHelper() */ public function testLoadWithAlias() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->helpers->load('SimpleAliased', ['className' => 'Simple']); $this->assertInstanceOf(SimpleHelper::class, $result); diff --git a/tests/TestCase/Console/ShellTest.php b/tests/TestCase/Console/ShellTest.php index e4545fa5112..15c44a72c9b 100644 --- a/tests/TestCase/Console/ShellTest.php +++ b/tests/TestCase/Console/ShellTest.php @@ -129,7 +129,7 @@ public function testInitialize() { static::setAppNamespace(); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $this->Shell->tasks = ['Extract' => ['one', 'two']]; $this->Shell->plugin = 'TestPlugin'; $this->Shell->modelClass = 'TestPlugin.TestPluginComments'; @@ -160,7 +160,7 @@ public function testLoadModel() ); $this->assertEquals('Articles', $Shell->modelClass); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Shell->loadModel('TestPlugin.TestPluginComments'); $this->assertInstanceOf( 'TestPlugin\Model\Table\TestPluginCommentsTable', diff --git a/tests/TestCase/Console/TaskRegistryTest.php b/tests/TestCase/Console/TaskRegistryTest.php index 0b02cbc0837..8a67d2683d4 100644 --- a/tests/TestCase/Console/TaskRegistryTest.php +++ b/tests/TestCase/Console/TaskRegistryTest.php @@ -88,7 +88,7 @@ public function testLoadPluginTask() $shell = $this->getMockBuilder('Cake\Console\Shell') ->disableOriginalConstructor() ->getMock(); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $this->Tasks = new TaskRegistry($shell, $dispatcher); $result = $this->Tasks->load('TestPlugin.OtherTask'); @@ -104,7 +104,7 @@ public function testLoadPluginTask() */ public function testLoadWithAlias() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Tasks->load('CommandAliased', ['className' => 'Command']); $this->assertInstanceOf('Cake\Shell\Task\CommandTask', $result); diff --git a/tests/TestCase/Controller/ComponentRegistryTest.php b/tests/TestCase/Controller/ComponentRegistryTest.php index 82d7facfc46..c3dd9ae240d 100644 --- a/tests/TestCase/Controller/ComponentRegistryTest.php +++ b/tests/TestCase/Controller/ComponentRegistryTest.php @@ -93,7 +93,7 @@ public function testLoadWithAlias() $result = $this->Components->load('Cookie'); $this->assertInstanceOf(__NAMESPACE__ . '\CookieAliasComponent', $result); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Components->load('SomeOther', ['className' => 'TestPlugin.Other']); $this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $result); $this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $this->Components->SomeOther); @@ -138,7 +138,7 @@ public function testLoadMissingComponent() */ public function testLoadPluginComponent() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Components->load('TestPlugin.Other'); $this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $result, 'Component class is wrong.'); $this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $this->Components->Other, 'Class is wrong'); @@ -151,7 +151,7 @@ public function testLoadPluginComponent() */ public function testLoadWithAliasAndPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Components->load('AliasedOther', ['className' => 'TestPlugin.Other']); $this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $result); $this->assertInstanceOf('TestPlugin\Controller\Component\OtherComponent', $this->Components->AliasedOther); diff --git a/tests/TestCase/Controller/ControllerTest.php b/tests/TestCase/Controller/ControllerTest.php index cc2df73dd8a..21ceb593336 100644 --- a/tests/TestCase/Controller/ControllerTest.php +++ b/tests/TestCase/Controller/ControllerTest.php @@ -318,7 +318,7 @@ public function testLoadModel() */ public function testLoadModelInPlugins() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $Controller = new TestPluginController(); $Controller->setPlugin('TestPlugin'); @@ -343,7 +343,7 @@ public function testLoadModelInPlugins() */ public function testConstructSetModelClass() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $request = new ServerRequest(); $response = new Response(); @@ -368,7 +368,7 @@ public function testConstructSetModelClass() */ public function testConstructClassesWithComponents() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $Controller = new TestPluginController(new ServerRequest(), new Response()); $Controller->loadComponent('TestPlugin.Other'); @@ -383,7 +383,7 @@ public function testConstructClassesWithComponents() */ public function testRender() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $request = new ServerRequest([ 'url' => 'controller_posts/index', diff --git a/tests/TestCase/Core/Configure/Engine/IniConfigTest.php b/tests/TestCase/Core/Configure/Engine/IniConfigTest.php index 3d2d08b9a30..ab58323d8ea 100644 --- a/tests/TestCase/Core/Configure/Engine/IniConfigTest.php +++ b/tests/TestCase/Core/Configure/Engine/IniConfigTest.php @@ -210,7 +210,7 @@ public function testReadWithDots() */ public function testReadPluginValue() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $engine = new IniConfig($this->path); $result = $engine->read('TestPlugin.nested'); diff --git a/tests/TestCase/Core/Configure/Engine/JsonConfigTest.php b/tests/TestCase/Core/Configure/Engine/JsonConfigTest.php index 4fa23428f78..eb3be6e8609 100644 --- a/tests/TestCase/Core/Configure/Engine/JsonConfigTest.php +++ b/tests/TestCase/Core/Configure/Engine/JsonConfigTest.php @@ -137,7 +137,7 @@ public function testReadWithDots() */ public function testReadPluginValue() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $engine = new JsonConfig($this->path); $result = $engine->read('TestPlugin.load'); $this->assertArrayHasKey('plugin_load', $result); diff --git a/tests/TestCase/Core/Configure/Engine/PhpConfigTest.php b/tests/TestCase/Core/Configure/Engine/PhpConfigTest.php index 91eaac7365e..f27d61f6dee 100644 --- a/tests/TestCase/Core/Configure/Engine/PhpConfigTest.php +++ b/tests/TestCase/Core/Configure/Engine/PhpConfigTest.php @@ -123,7 +123,7 @@ public function testReadWithDots() */ public function testReadPluginValue() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $engine = new PhpConfig($this->path); $result = $engine->read('TestPlugin.load'); $this->assertArrayHasKey('plugin_load', $result); diff --git a/tests/TestCase/Core/ConfigureTest.php b/tests/TestCase/Core/ConfigureTest.php index 6fba90e8ded..15053f4beb0 100644 --- a/tests/TestCase/Core/ConfigureTest.php +++ b/tests/TestCase/Core/ConfigureTest.php @@ -394,7 +394,7 @@ public function testLoadMergeWithExistingData() public function testLoadPlugin() { Configure::config('test', new PhpConfig()); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = Configure::load('TestPlugin.load', 'test'); $this->assertTrue($result); $expected = '/test_app/Plugin/TestPlugin/Config/load.php'; diff --git a/tests/TestCase/Datasource/ConnectionManagerTest.php b/tests/TestCase/Datasource/ConnectionManagerTest.php index 603e2632e8d..559d15f53b1 100644 --- a/tests/TestCase/Datasource/ConnectionManagerTest.php +++ b/tests/TestCase/Datasource/ConnectionManagerTest.php @@ -202,7 +202,7 @@ public function testConfigured() */ public function testGetPluginDataSource() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $name = 'test_variant'; $config = ['className' => 'TestPlugin.TestSource', 'foo' => 'bar']; ConnectionManager::setConfig($name, $config); diff --git a/tests/TestCase/Error/ErrorHandlerTest.php b/tests/TestCase/Error/ErrorHandlerTest.php index 8e10be87356..db5e7bcbda1 100644 --- a/tests/TestCase/Error/ErrorHandlerTest.php +++ b/tests/TestCase/Error/ErrorHandlerTest.php @@ -381,7 +381,7 @@ public function testHandleExceptionLogSkipping() */ public function testLoadPluginHandler() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $errorHandler = new TestErrorHandler([ 'exceptionRenderer' => 'TestPlugin.TestPluginExceptionRenderer', ]); diff --git a/tests/TestCase/Error/ExceptionRendererTest.php b/tests/TestCase/Error/ExceptionRendererTest.php index 5ce834948dd..eed0d478d4b 100644 --- a/tests/TestCase/Error/ExceptionRendererTest.php +++ b/tests/TestCase/Error/ExceptionRendererTest.php @@ -803,7 +803,7 @@ public function testMissingPluginRenderSafe() */ public function testMissingPluginRenderSafeWithPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $exception = new NotFoundException(); $ExceptionRenderer = new ExceptionRenderer($exception); diff --git a/tests/TestCase/Http/SessionTest.php b/tests/TestCase/Http/SessionTest.php index 67b129bc4c3..2ddb93d7e49 100644 --- a/tests/TestCase/Http/SessionTest.php +++ b/tests/TestCase/Http/SessionTest.php @@ -496,7 +496,7 @@ public function testUsingAppLibsHandler() public function testUsingPluginHandler() { static::setAppNamespace(); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $config = [ 'defaults' => 'cake', diff --git a/tests/TestCase/I18n/I18nTest.php b/tests/TestCase/I18n/I18nTest.php index e301a07d98f..332f75e97cc 100644 --- a/tests/TestCase/I18n/I18nTest.php +++ b/tests/TestCase/I18n/I18nTest.php @@ -206,7 +206,7 @@ public function testPluginMesagesLoad() */ public function testPluginOverride() { - $this->loadPlugins('TestTheme'); + $this->loadPlugins(['TestTheme']); $translator = I18n::getTranslator('test_theme'); $this->assertEquals( 'translated', diff --git a/tests/TestCase/Log/LogTest.php b/tests/TestCase/Log/LogTest.php index 165ef4bedf7..bff6e50e26b 100644 --- a/tests/TestCase/Log/LogTest.php +++ b/tests/TestCase/Log/LogTest.php @@ -44,7 +44,7 @@ public function tearDown() public function testImportingLoggers() { static::setAppNamespace(); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); Log::setConfig('libtest', [ 'engine' => 'TestApp' diff --git a/tests/TestCase/Mailer/EmailTest.php b/tests/TestCase/Mailer/EmailTest.php index d00797d9366..e03678e42e8 100644 --- a/tests/TestCase/Mailer/EmailTest.php +++ b/tests/TestCase/Mailer/EmailTest.php @@ -1746,7 +1746,7 @@ public function testSendRenderJapanese() */ public function testSendRenderThemed() { - $this->loadPlugins('TestTheme'); + $this->loadPlugins(['TestTheme']); $this->Email->reset(); $this->Email->setTransport('debug'); diff --git a/tests/TestCase/ORM/AssociationTest.php b/tests/TestCase/ORM/AssociationTest.php index f3316cb2c8c..21f903bb986 100644 --- a/tests/TestCase/ORM/AssociationTest.php +++ b/tests/TestCase/ORM/AssociationTest.php @@ -436,7 +436,7 @@ public function testSetTarget() */ public function testTargetPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $config = [ 'className' => 'TestPlugin.Comments', 'foreignKey' => 'a_key', diff --git a/tests/TestCase/ORM/BehaviorRegistryTest.php b/tests/TestCase/ORM/BehaviorRegistryTest.php index 26d9fc68c48..b61a4483b0a 100644 --- a/tests/TestCase/ORM/BehaviorRegistryTest.php +++ b/tests/TestCase/ORM/BehaviorRegistryTest.php @@ -58,7 +58,7 @@ public function tearDown() */ public function testClassName() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $expected = 'Cake\ORM\Behavior\TranslateBehavior'; $result = BehaviorRegistry::className('Translate'); @@ -78,7 +78,7 @@ public function testClassName() */ public function testLoad() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $config = ['alias' => 'Sluggable', 'replacement' => '-']; $result = $this->Behaviors->load('Sluggable', $config); $this->assertInstanceOf('TestApp\Model\Behavior\SluggableBehavior', $result); @@ -127,7 +127,7 @@ public function testLoadEnabledFalse() */ public function testLoadPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Behaviors->load('TestPlugin.PersisterOne'); $expected = 'TestPlugin\Model\Behavior\PersisterOneBehavior'; @@ -220,7 +220,7 @@ public function testLoadDuplicateFinderAliasing() */ public function testHasMethod() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $this->Behaviors->load('TestPlugin.PersisterOne'); $this->Behaviors->load('Sluggable'); diff --git a/tests/TestCase/ORM/Locator/TableLocatorTest.php b/tests/TestCase/ORM/Locator/TableLocatorTest.php index f3187dad53a..68afc236c30 100644 --- a/tests/TestCase/ORM/Locator/TableLocatorTest.php +++ b/tests/TestCase/ORM/Locator/TableLocatorTest.php @@ -124,7 +124,7 @@ public function testGetConfig() */ public function testConfigPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $data = [ 'connection' => 'testing', @@ -336,7 +336,7 @@ public function testGetWithConventions() */ public function testGetPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $table = $this->_locator->get('TestPlugin.TestPluginComments'); $this->assertInstanceOf('TestPlugin\Model\Table\TestPluginCommentsTable', $table); @@ -388,7 +388,7 @@ public function testGetMultiplePlugins() */ public function testGetPluginWithClassNameOption() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $table = $this->_locator->get('Comments', [ 'className' => 'TestPlugin.TestPluginComments', ]); @@ -409,7 +409,7 @@ public function testGetPluginWithClassNameOption() */ public function testGetPluginWithFullNamespaceName() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $class = 'TestPlugin\Model\Table\TestPluginCommentsTable'; $table = $this->_locator->get('Comments', [ 'className' => $class, @@ -522,7 +522,7 @@ public function testSet() */ public function testSetPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $mock = $this->getMockBuilder('TestPlugin\Model\Table\CommentsTable')->getMock(); diff --git a/tests/TestCase/ORM/QueryRegressionTest.php b/tests/TestCase/ORM/QueryRegressionTest.php index 7b248029c61..46c8aaa3fc9 100644 --- a/tests/TestCase/ORM/QueryRegressionTest.php +++ b/tests/TestCase/ORM/QueryRegressionTest.php @@ -527,7 +527,7 @@ public function testBelongsToManyDeepSave2() public function testPluginAssociationQueryGeneration() { $this->loadFixtures('Articles', 'Comments', 'Authors'); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $articles = $this->getTableLocator()->get('Articles'); $articles->hasMany('TestPlugin.Comments'); $articles->belongsTo('TestPlugin.Authors'); diff --git a/tests/TestCase/ORM/ResultSetTest.php b/tests/TestCase/ORM/ResultSetTest.php index 4a27ef9eb18..3ec8add48ef 100644 --- a/tests/TestCase/ORM/ResultSetTest.php +++ b/tests/TestCase/ORM/ResultSetTest.php @@ -382,7 +382,7 @@ public function testFetchMissingDefaultAlias() */ public function testSourceOnContainAssociations() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $comments = $this->getTableLocator()->get('TestPlugin.Comments'); $comments->belongsTo('Authors', [ 'className' => 'TestPlugin.Authors', diff --git a/tests/TestCase/ORM/TableTest.php b/tests/TestCase/ORM/TableTest.php index f86cce849c7..c6648fedee0 100644 --- a/tests/TestCase/ORM/TableTest.php +++ b/tests/TestCase/ORM/TableTest.php @@ -891,7 +891,7 @@ public function testHasManyWithClassName() public function testHasManyPluginOverlap() { $this->getTableLocator()->get('Comments'); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $table = new Table(['table' => 'authors']); @@ -909,7 +909,7 @@ public function testHasManyPluginOverlap() public function testHasManyPluginOverlapConfig() { $this->getTableLocator()->get('Comments'); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $table = new Table(['table' => 'authors']); @@ -3714,7 +3714,7 @@ public function testHasValidator() */ public function testEntitySourceExistingAndNew() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $table = $this->getTableLocator()->get('TestPlugin.Authors'); $existingAuthor = $table->find()->first(); @@ -6495,7 +6495,7 @@ public function testEntitySource() $table = $this->getTableLocator()->get('Articles'); $this->assertEquals('Articles', $table->newEntity()->source()); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $table = $this->getTableLocator()->get('TestPlugin.Comments'); $this->assertEquals('TestPlugin.Comments', $table->newEntity()->source()); }); @@ -6511,7 +6511,7 @@ public function testSetEntitySource() $table = $this->getTableLocator()->get('Articles'); $this->assertEquals('Articles', $table->newEntity()->getSource()); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $table = $this->getTableLocator()->get('TestPlugin.Comments'); $this->assertEquals('TestPlugin.Comments', $table->newEntity()->getSource()); } diff --git a/tests/TestCase/Routing/DispatcherTest.php b/tests/TestCase/Routing/DispatcherTest.php index 3633489acb8..ecc8a96a14a 100644 --- a/tests/TestCase/Routing/DispatcherTest.php +++ b/tests/TestCase/Routing/DispatcherTest.php @@ -209,7 +209,7 @@ public function testDispatchBadPluginName() { $this->expectException(\Cake\Routing\Exception\MissingControllerException::class); $this->expectExceptionMessage('Controller class TestPlugin.Tests could not be found.'); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $request = new ServerRequest([ 'url' => 'TestPlugin.Tests/index', diff --git a/tests/TestCase/Routing/RequestActionTraitTest.php b/tests/TestCase/Routing/RequestActionTraitTest.php index 62fa57a9fd6..e977f83c987 100644 --- a/tests/TestCase/Routing/RequestActionTraitTest.php +++ b/tests/TestCase/Routing/RequestActionTraitTest.php @@ -126,7 +126,7 @@ public function testRequestAction() */ public function testRequestActionPlugins() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); Router::reload(); Router::connect('/test_plugin/tests/:action/*', ['controller' => 'Tests', 'plugin' => 'TestPlugin']); diff --git a/tests/TestCase/Routing/RouteBuilderTest.php b/tests/TestCase/Routing/RouteBuilderTest.php index 63c72b8279b..d763b3e8519 100644 --- a/tests/TestCase/Routing/RouteBuilderTest.php +++ b/tests/TestCase/Routing/RouteBuilderTest.php @@ -1209,7 +1209,7 @@ public function testLoadPluginBadFile() $this->deprecated(function () { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Cannot load routes for the plugin named TestPlugin.'); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $routes = new RouteBuilder($this->collection, '/'); $routes->loadPlugin('TestPlugin', 'nope.php'); }); @@ -1222,7 +1222,7 @@ public function testLoadPluginBadFile() */ public function testLoadPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $routes = new RouteBuilder($this->collection, '/'); $routes->loadPlugin('TestPlugin'); $this->assertCount(1, $this->collection->routes()); diff --git a/tests/TestCase/Routing/RouterTest.php b/tests/TestCase/Routing/RouterTest.php index bcc9c29e8f2..134928c086d 100644 --- a/tests/TestCase/Routing/RouterTest.php +++ b/tests/TestCase/Routing/RouterTest.php @@ -2632,7 +2632,7 @@ public function testRegexRouteMatchUrl() */ public function testUsingCustomRouteClass() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); Router::connect( '/:slug', ['plugin' => 'TestPlugin', 'action' => 'index'], @@ -2657,7 +2657,7 @@ public function testUsingCustomRouteClass() */ public function testUsingCustomRouteClassPluginDotSyntax() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); Router::connect( '/:slug', ['controller' => 'posts', 'action' => 'view'], diff --git a/tests/TestCase/Shell/Task/AssetsTaskTest.php b/tests/TestCase/Shell/Task/AssetsTaskTest.php index 5d81f0dc320..9afcda2fc88 100644 --- a/tests/TestCase/Shell/Task/AssetsTaskTest.php +++ b/tests/TestCase/Shell/Task/AssetsTaskTest.php @@ -99,7 +99,7 @@ public function testSymlink() */ public function testSymlinkWhenVendorDirectoryExits() { - $this->loadPlugins('Company/TestPluginThree'); + $this->loadPlugins(['Company/TestPluginThree']); mkdir(WWW_ROOT . 'company'); @@ -122,7 +122,7 @@ public function testSymlinkWhenVendorDirectoryExits() */ public function testSymlinkWhenTargetAlreadyExits() { - $this->loadPlugins('TestTheme'); + $this->loadPlugins(['TestTheme']); $shell = $this->getMockBuilder('Cake\Shell\Task\AssetsTask') ->setMethods(['in', 'out', 'err', '_stop', '_createSymlink', '_copyDirectory']) @@ -143,7 +143,7 @@ public function testSymlinkWhenTargetAlreadyExits() */ public function testForPluginWithoutWebroot() { - $this->loadPlugins('TestPluginTwo'); + $this->loadPlugins(['TestPluginTwo']); $this->Task->symlink(); $this->assertFileNotExists(WWW_ROOT . 'test_plugin_two'); @@ -203,7 +203,7 @@ public function testCopy() */ public function testCopyOverwrite() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $this->Task->copy(); diff --git a/tests/TestCase/TestSuite/FixtureManagerTest.php b/tests/TestCase/TestSuite/FixtureManagerTest.php index 769f2e74a68..a8fe703fb69 100644 --- a/tests/TestCase/TestSuite/FixtureManagerTest.php +++ b/tests/TestCase/TestSuite/FixtureManagerTest.php @@ -191,7 +191,7 @@ public function testFixturizeCoreConstraint() */ public function testFixturizePlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $test = $this->getMockBuilder('Cake\TestSuite\TestCase')->getMock(); $test->fixtures = ['plugin.test_plugin.articles']; @@ -212,7 +212,7 @@ public function testFixturizePlugin() */ public function testFixturizePluginSubdirectory() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $test = $this->getMockBuilder('Cake\TestSuite\TestCase')->getMock(); $test->fixtures = ['plugin.test_plugin.blog/comments']; diff --git a/tests/TestCase/TestSuite/TestCaseTest.php b/tests/TestCase/TestSuite/TestCaseTest.php index 06bdffbb15d..82cd0afb796 100644 --- a/tests/TestCase/TestSuite/TestCaseTest.php +++ b/tests/TestCase/TestSuite/TestCaseTest.php @@ -440,7 +440,7 @@ public function testGetMockForModelSecondaryDatasource() public function testGetMockForModelWithPlugin() { static::setAppNamespace(); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $TestPluginComment = $this->getMockForModel('TestPlugin.TestPluginComments'); $result = $this->getTableLocator()->get('TestPlugin.TestPluginComments'); diff --git a/tests/TestCase/View/Helper/FlashHelperTest.php b/tests/TestCase/View/Helper/FlashHelperTest.php index b34654f5ac2..1da7d0552a8 100644 --- a/tests/TestCase/View/Helper/FlashHelperTest.php +++ b/tests/TestCase/View/Helper/FlashHelperTest.php @@ -176,7 +176,7 @@ public function testFlashElementInAttrs() */ public function testFlashWithPluginElement() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Flash->render('flash', ['element' => 'TestPlugin.Flash/plugin_element']); $expected = 'this is the plugin element'; @@ -190,7 +190,7 @@ public function testFlashWithPluginElement() */ public function testFlashWithTheme() { - $this->loadPlugins('TestTheme'); + $this->loadPlugins(['TestTheme']); $this->View->setTheme('TestTheme'); $result = $this->Flash->render('flash'); diff --git a/tests/TestCase/View/Helper/HtmlHelperTest.php b/tests/TestCase/View/Helper/HtmlHelperTest.php index 4ab3c9d95d5..24176255125 100644 --- a/tests/TestCase/View/Helper/HtmlHelperTest.php +++ b/tests/TestCase/View/Helper/HtmlHelperTest.php @@ -595,7 +595,7 @@ public function testCssLink() $result = $this->Html->css('screen.css', ['once' => false]); $this->assertHtml($expected, $result); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Html->css('TestPlugin.style', ['plugin' => false]); $expected['link']['href'] = 'preg:/.*css\/TestPlugin\.style\.css/'; $this->assertHtml($expected, $result); @@ -708,7 +708,7 @@ public function testCssWithFullBase() */ public function testPluginCssLink() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Html->css('TestPlugin.test_plugin_asset'); $expected = [ @@ -788,7 +788,7 @@ public function testCssTimestamping() */ public function testPluginCssTimestamping() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); Configure::write('debug', true); Configure::write('Asset.timestamp', true); @@ -875,7 +875,7 @@ public function testScriptTimestamping() */ public function testPluginScriptTimestamping() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $pluginPath = Plugin::path('TestPlugin'); $pluginJsPath = $pluginPath . 'webroot/js'; @@ -1010,7 +1010,7 @@ public function testScript() */ public function testPluginScript() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Html->script('TestPlugin.foo'); $expected = [ diff --git a/tests/TestCase/View/Helper/NumberHelperTest.php b/tests/TestCase/View/Helper/NumberHelperTest.php index d01404ca09f..1e2bff27f6d 100644 --- a/tests/TestCase/View/Helper/NumberHelperTest.php +++ b/tests/TestCase/View/Helper/NumberHelperTest.php @@ -128,7 +128,7 @@ public function testEngineOverride() $Number = new NumberHelperTestObject($this->View, ['engine' => 'TestAppEngine']); $this->assertInstanceOf('TestApp\Utility\TestAppEngine', $Number->engine()); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $Number = new NumberHelperTestObject($this->View, ['engine' => 'TestPlugin.TestPluginEngine']); $this->assertInstanceOf('TestPlugin\Utility\TestPluginEngine', $Number->engine()); Plugin::unload('TestPlugin'); diff --git a/tests/TestCase/View/Helper/TextHelperTest.php b/tests/TestCase/View/Helper/TextHelperTest.php index 55d4ff79d10..f2ab11a1eca 100644 --- a/tests/TestCase/View/Helper/TextHelperTest.php +++ b/tests/TestCase/View/Helper/TextHelperTest.php @@ -139,7 +139,7 @@ public function testEngineOverride() $Text = new TextHelperTestObject($this->View, ['engine' => 'TestAppEngine']); $this->assertInstanceOf('TestApp\Utility\TestAppEngine', $Text->engine()); - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $Text = new TextHelperTestObject($this->View, ['engine' => 'TestPlugin.TestPluginEngine']); $this->assertInstanceOf('TestPlugin\Utility\TestPluginEngine', $Text->engine()); Plugin::unload(); diff --git a/tests/TestCase/View/Helper/UrlHelperTest.php b/tests/TestCase/View/Helper/UrlHelperTest.php index 667e1f5ece5..02b991bc7d0 100644 --- a/tests/TestCase/View/Helper/UrlHelperTest.php +++ b/tests/TestCase/View/Helper/UrlHelperTest.php @@ -279,7 +279,7 @@ public function testAssetUrlNoRewrite() public function testAssetUrlPlugin() { $this->Helper->webroot = ''; - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Helper->assetUrl('TestPlugin.style', ['ext' => '.css']); $this->assertEquals('test_plugin/style.css', $result); diff --git a/tests/TestCase/View/HelperRegistryTest.php b/tests/TestCase/View/HelperRegistryTest.php index 8b759364194..fe54e41bc76 100644 --- a/tests/TestCase/View/HelperRegistryTest.php +++ b/tests/TestCase/View/HelperRegistryTest.php @@ -154,7 +154,7 @@ public function testLoadWithAlias() */ public function testLoadWithAliasAndPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $result = $this->Helpers->load('SomeOther', ['className' => 'TestPlugin.OtherHelper']); $this->assertInstanceOf('TestPlugin\View\Helper\OtherHelperHelper', $result); $this->assertInstanceOf('TestPlugin\View\Helper\OtherHelperHelper', $this->Helpers->SomeOther); diff --git a/tests/TestCase/View/StringTemplateTest.php b/tests/TestCase/View/StringTemplateTest.php index ad056398d12..c4aec3723f5 100644 --- a/tests/TestCase/View/StringTemplateTest.php +++ b/tests/TestCase/View/StringTemplateTest.php @@ -192,7 +192,7 @@ public function testLoad() */ public function testLoadPlugin() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $this->assertNull($this->template->load('TestPlugin.test_templates')); $this->assertEquals('{{text}}', $this->template->get('italic')); Plugin::unload(); diff --git a/tests/TestCase/View/Widget/WidgetLocatorTest.php b/tests/TestCase/View/Widget/WidgetLocatorTest.php index 4d7ac31c030..dc561ffdb94 100644 --- a/tests/TestCase/View/Widget/WidgetLocatorTest.php +++ b/tests/TestCase/View/Widget/WidgetLocatorTest.php @@ -92,7 +92,7 @@ public function testAddWidgetsFromConfigInConstructor() */ public function testAddPluginWidgetsFromConfigInConstructor() { - $this->loadPlugins('TestPlugin'); + $this->loadPlugins(['TestPlugin']); $widgets = [ 'text' => ['Cake\View\Widget\BasicWidget'], 'TestPlugin.test_widgets',