diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-07-26 14:43:10 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-26 14:43:10 +0200 |
commit | 9fbc42294e7667c5ef19cafa0d1fcfbc1c0f36a9 (patch) | |
tree | 9bfc3c9b185eb0c185d23146d44d42dd6685a4da /tests/front/controller/admin/PluginsControllerTest.php | |
parent | bc583903adfd768f115fae438e4d9ed1043682d9 (diff) | |
download | Shaarli-9fbc42294e7667c5ef19cafa0d1fcfbc1c0f36a9.tar.gz Shaarli-9fbc42294e7667c5ef19cafa0d1fcfbc1c0f36a9.tar.zst Shaarli-9fbc42294e7667c5ef19cafa0d1fcfbc1c0f36a9.zip |
New basePath: fix officiel plugin paths and vintage template
Diffstat (limited to 'tests/front/controller/admin/PluginsControllerTest.php')
-rw-r--r-- | tests/front/controller/admin/PluginsControllerTest.php | 14 |
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; | |||
7 | use PHPUnit\Framework\TestCase; | 7 | use PHPUnit\Framework\TestCase; |
8 | use Shaarli\Config\ConfigManager; | 8 | use Shaarli\Config\ConfigManager; |
9 | use Shaarli\Front\Exception\WrongTokenException; | 9 | use Shaarli\Front\Exception\WrongTokenException; |
10 | use Shaarli\Plugin\PluginManager; | ||
10 | use Shaarli\Security\SessionManager; | 11 | use Shaarli\Security\SessionManager; |
11 | use Slim\Http\Request; | 12 | use Slim\Http\Request; |
12 | use Slim\Http\Response; | 13 | use 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 | /** |