Browse Source

Rename PluginApp -> BasePlugin

This better mirrors the base class name for applications.
Mark Story 8 years ago
parent
commit
a3522fbcde

+ 1 - 1
src/Core/PluginApp.php

@@ -23,7 +23,7 @@ use ReflectionClass;
  * Every plugin should extends from this class or implement the interfaces and
  * include a plugin class in it's src root folder.
  */
-class PluginApp implements PluginInterface
+class BasePlugin implements PluginInterface
 {
 
     /**

+ 1 - 1
src/Core/Plugin.php

@@ -156,7 +156,7 @@ class Plugin
         }
 
         // Use stub plugins as this method will be removed long term.
-        static::getCollection()->add(new PluginApp($config));
+        static::getCollection()->add(new BasePlugin($config));
 
         if ($config['autoload'] === true) {
             if (empty(static::$_loader)) {

+ 11 - 11
tests/TestCase/Core/PluginAppTest.php

@@ -14,8 +14,8 @@
 namespace Cake\Test\TestCase\Core;
 
 use Cake\Console\CommandCollection;
+use Cake\Core\BasePlugin;
 use Cake\Core\Plugin;
-use Cake\Core\PluginApp;
 use Cake\Event\EventManager;
 use Cake\Http\MiddlewareQueue;
 use Cake\TestSuite\TestCase;
@@ -23,9 +23,9 @@ use Company\TestPluginThree\Plugin as TestPluginThree;
 use TestPlugin\Plugin as TestPlugin;
 
 /**
- * PluginAppTest class
+ * BasePluginTest class
  */
-class PluginAppTest extends TestCase
+class BasePluginTest extends TestCase
 {
 
     /**
@@ -46,7 +46,7 @@ class PluginAppTest extends TestCase
      */
     public function testConfigForRoutesAndBootstrap()
     {
-        $plugin = new PluginApp([
+        $plugin = new BasePlugin([
             'bootstrap' => false,
             'routes' => false
         ]);
@@ -74,28 +74,28 @@ class PluginAppTest extends TestCase
 
     public function testMiddleware()
     {
-        $plugin = new PluginApp();
+        $plugin = new BasePlugin();
         $middleware = new MiddlewareQueue();
         $this->assertSame($middleware, $plugin->middleware($middleware));
     }
 
     public function testConsole()
     {
-        $plugin = new PluginApp();
+        $plugin = new BasePlugin();
         $commands = new CommandCollection();
         $this->assertSame($commands, $plugin->console($commands));
     }
 
     public function testEvents()
     {
-        $plugin = new PluginApp();
+        $plugin = new BasePlugin();
         $events = new EventManager();
-        $this->assertNull($plugin->events($events));
+        $this->assertSame($events, $plugin->events($events));
     }
 
     public function testConstructorArguments()
     {
-        $plugin = new PluginApp([
+        $plugin = new BasePlugin([
             'routes' => false,
             'bootstrap' => false,
             'console' => false,
@@ -109,7 +109,7 @@ class PluginAppTest extends TestCase
 
     public function testGetPathBaseClass()
     {
-        $plugin = new PluginApp();
+        $plugin = new BasePlugin();
 
         $expected = CAKE . 'Core' . DS;
         $this->assertSame($expected, $plugin->getPath());
@@ -119,7 +119,7 @@ class PluginAppTest extends TestCase
 
     public function testGetPathOptionValue()
     {
-        $plugin = new PluginApp(['path' => '/some/path']);
+        $plugin = new BasePlugin(['path' => '/some/path']);
         $expected = '/some/path';
         $this->assertSame($expected, $plugin->getPath());
         $this->assertSame($expected . 'config' . DS, $plugin->getConfigPath());

+ 2 - 2
tests/test_app/Plugin/Company/TestPluginFive/src/Plugin.php

@@ -13,9 +13,9 @@
  */
 namespace Company\TestPluginFive;
 
-use Cake\Core\PluginApp;
+use Cake\Core\BasePlugin;
 
-class Plugin extends PluginApp
+class Plugin extends BasePlugin
 {
 
 }

+ 2 - 2
tests/test_app/Plugin/Company/TestPluginThree/src/Plugin.php

@@ -13,9 +13,9 @@
  */
 namespace Company\TestPluginThree;
 
-use Cake\Core\PluginApp;
+use Cake\Core\BasePlugin;
 
-class Plugin extends PluginApp
+class Plugin extends BasePlugin
 {
 
 }

+ 2 - 2
tests/test_app/Plugin/TestPlugin/src/Plugin.php

@@ -13,10 +13,10 @@
  */
 namespace TestPlugin;
 
-use Cake\Core\PluginApp;
+use Cake\Core\BasePlugin;
 use Cake\Event\EventManagerInterface;
 
-class Plugin extends PluginApp
+class Plugin extends BasePlugin
 {
     public function events(EventManagerInterface $events)
     {