aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/admin/PluginsControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/front/controller/admin/PluginsControllerTest.php')
-rw-r--r--tests/front/controller/admin/PluginsControllerTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/front/controller/admin/PluginsControllerTest.php b/tests/front/controller/admin/PluginsControllerTest.php
index ad0cda70..5b59285c 100644
--- a/tests/front/controller/admin/PluginsControllerTest.php
+++ b/tests/front/controller/admin/PluginsControllerTest.php
@@ -7,6 +7,7 @@ namespace Shaarli\Front\Controller\Admin;
7use PHPUnit\Framework\TestCase; 7use PHPUnit\Framework\TestCase;
8use Shaarli\Config\ConfigManager; 8use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\WrongTokenException; 9use Shaarli\Front\Exception\WrongTokenException;
10use Shaarli\Plugin\PluginManager;
10use Shaarli\Security\SessionManager; 11use Shaarli\Security\SessionManager;
11use Slim\Http\Request; 12use Slim\Http\Request;
12use Slim\Http\Response; 13use Slim\Http\Response;
@@ -15,6 +16,8 @@ class PluginsControllerTest extends TestCase
15{ 16{
16 use FrontAdminControllerMockHelper; 17 use FrontAdminControllerMockHelper;
17 18
19 const PLUGIN_NAMES = ['plugin1', 'plugin2', 'plugin3', 'plugin4'];
20
18 /** @var PluginsController */ 21 /** @var PluginsController */
19 protected $controller; 22 protected $controller;
20 23
@@ -23,6 +26,17 @@ class PluginsControllerTest extends TestCase
23 $this->createContainer(); 26 $this->createContainer();
24 27
25 $this->controller = new PluginsController($this->container); 28 $this->controller = new PluginsController($this->container);
29
30 mkdir($path = __DIR__ . '/folder');
31 PluginManager::$PLUGINS_PATH = $path;
32 array_map(function (string $plugin) use ($path) { touch($path . '/' . $plugin); }, static::PLUGIN_NAMES);
33 }
34
35 public function tearDown()
36 {
37 $path = __DIR__ . '/folder';
38 array_map(function (string $plugin) use ($path) { unlink($path . '/' . $plugin); }, static::PLUGIN_NAMES);
39 rmdir($path);
26 } 40 }
27 41
28 /** 42 /**