Browse Source

just adding plugin without bootstrap

just adding plugin without bootstrap
in ConsoleIntegrationTestCase
saeid 7 years ago
parent
commit
7be710d148

+ 18 - 1
tests/TestCase/Command/HelpCommandTest.php

@@ -16,6 +16,7 @@ namespace Cake\Test\TestCase\Command;
 
 use Cake\Console\Shell;
 use Cake\Core\Plugin;
+use Cake\Http\BaseApplication;
 use Cake\TestSuite\ConsoleIntegrationTestCase;
 
 /**
@@ -33,7 +34,23 @@ class HelpCommandTest extends ConsoleIntegrationTestCase
         parent::setUp();
         $this->setAppNamespace();
         $this->useCommandRunner(true);
-        $this->loadPlugins('TestPlugin');
+        Plugin::unload();
+        $app = $this->getMockForAbstractClass(
+            BaseApplication::class,
+            ['']
+        );
+        $app->addPlugin('TestPlugin');
+    }
+
+    /**
+     * tearDown
+     *
+     * @return void
+     */
+    public function tearDown()
+    {
+        parent::tearDown();
+        Plugin::unload();
     }
 
     /**

+ 1 - 1
tests/TestCase/View/StringTemplateTest.php

@@ -14,9 +14,9 @@
  */
 namespace Cake\Test\TestCase\View;
 
+use Cake\Core\Plugin;
 use Cake\TestSuite\TestCase;
 use Cake\View\StringTemplate;
-use Cake\Core\Plugin;
 
 class StringTemplateTest extends TestCase
 {