From 9fbc42294e7667c5ef19cafa0d1fcfbc1c0f36a9 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 26 Jul 2020 14:43:10 +0200 Subject: New basePath: fix officiel plugin paths and vintage template --- tests/front/controller/admin/PluginsControllerTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/front/controller/admin/PluginsControllerTest.php') 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; use PHPUnit\Framework\TestCase; use Shaarli\Config\ConfigManager; use Shaarli\Front\Exception\WrongTokenException; +use Shaarli\Plugin\PluginManager; use Shaarli\Security\SessionManager; use Slim\Http\Request; use Slim\Http\Response; @@ -15,6 +16,8 @@ class PluginsControllerTest extends TestCase { use FrontAdminControllerMockHelper; + const PLUGIN_NAMES = ['plugin1', 'plugin2', 'plugin3', 'plugin4']; + /** @var PluginsController */ protected $controller; @@ -23,6 +26,17 @@ class PluginsControllerTest extends TestCase $this->createContainer(); $this->controller = new PluginsController($this->container); + + mkdir($path = __DIR__ . '/folder'); + PluginManager::$PLUGINS_PATH = $path; + array_map(function (string $plugin) use ($path) { touch($path . '/' . $plugin); }, static::PLUGIN_NAMES); + } + + public function tearDown() + { + $path = __DIR__ . '/folder'; + array_map(function (string $plugin) use ($path) { unlink($path . '/' . $plugin); }, static::PLUGIN_NAMES); + rmdir($path); } /** -- cgit v1.2.3