ソースを参照

Remove tests that use now removed Plugin::load().

mark_story 7 年 前
コミット
d78f0e2362

+ 0 - 25
tests/TestCase/Http/BaseApplicationTest.php

@@ -183,31 +183,6 @@ class BaseApplicationTest extends TestCase
     }
 
     /**
-     * Ensure that plugins loaded via Plugin::load()
-     * don't have their bootstrapping run twice.
-     *
-     * @return void
-     */
-    public function testPluginBootstrapInteractWithPluginLoad()
-    {
-        $this->deprecated(function () {
-            Plugin::load('TestPlugin', ['bootstrap' => true]);
-            $app = $this->getMockForAbstractClass(
-                BaseApplication::class,
-                [$this->path]
-            );
-            $this->assertTrue(Configure::check('PluginTest.test_plugin.bootstrap'));
-            Configure::delete('PluginTest.test_plugin.bootstrap');
-
-            $this->assertNull($app->pluginBootstrap());
-            $this->assertFalse(
-                Configure::check('PluginTest.test_plugin.bootstrap'),
-                'Key should not be set, as plugin has already had bootstrap run'
-            );
-        });
-    }
-
-    /**
      * Test that plugins loaded with addPlugin() can load additional
      * plugins.
      *

+ 1 - 2
tests/test_app/Plugin/ParentPlugin/src/Plugin.php

@@ -3,7 +3,6 @@ namespace ParentPlugin;
 
 use Cake\Core\BasePlugin;
 use Cake\Core\Configure;
-use Cake\Core\Plugin as CorePlugin;
 use Cake\Core\PluginApplicationInterface;
 
 class Plugin extends BasePlugin
@@ -12,7 +11,7 @@ class Plugin extends BasePlugin
     {
         Configure::write('ParentPlugin.bootstrap', true);
 
-        CorePlugin::load('TestPluginTwo', ['bootstrap' => true]);
+        $app->addPlugin('TestPluginTwo', ['bootstrap' => true]);
         $app->addPlugin('TestPlugin', ['bootstrap' => true]);
     }
 }