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.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/front/controller/admin/PluginsControllerTest.php b/tests/front/controller/admin/PluginsControllerTest.php
index 5b59285c..974d614d 100644
--- a/tests/front/controller/admin/PluginsControllerTest.php
+++ b/tests/front/controller/admin/PluginsControllerTest.php
@@ -4,11 +4,11 @@ declare(strict_types=1);
4 4
5namespace Shaarli\Front\Controller\Admin; 5namespace Shaarli\Front\Controller\Admin;
6 6
7use PHPUnit\Framework\TestCase;
8use Shaarli\Config\ConfigManager; 7use Shaarli\Config\ConfigManager;
9use Shaarli\Front\Exception\WrongTokenException; 8use Shaarli\Front\Exception\WrongTokenException;
10use Shaarli\Plugin\PluginManager; 9use Shaarli\Plugin\PluginManager;
11use Shaarli\Security\SessionManager; 10use Shaarli\Security\SessionManager;
11use Shaarli\TestCase;
12use Slim\Http\Request; 12use Slim\Http\Request;
13use Slim\Http\Response; 13use Slim\Http\Response;
14 14
@@ -32,7 +32,7 @@ class PluginsControllerTest extends TestCase
32 array_map(function (string $plugin) use ($path) { touch($path . '/' . $plugin); }, static::PLUGIN_NAMES); 32 array_map(function (string $plugin) use ($path) { touch($path . '/' . $plugin); }, static::PLUGIN_NAMES);
33 } 33 }
34 34
35 public function tearDown() 35 public function tearDown(): void
36 { 36 {
37 $path = __DIR__ . '/folder'; 37 $path = __DIR__ . '/folder';
38 array_map(function (string $plugin) use ($path) { unlink($path . '/' . $plugin); }, static::PLUGIN_NAMES); 38 array_map(function (string $plugin) use ($path) { unlink($path . '/' . $plugin); }, static::PLUGIN_NAMES);
@@ -125,6 +125,7 @@ class PluginsControllerTest extends TestCase
125 'parameters_form' => true, 125 'parameters_form' => true,
126 'parameter1' => 'blip', 126 'parameter1' => 'blip',
127 'parameter2' => 'blop', 127 'parameter2' => 'blop',
128 'token' => 'this parameter should not be saved'
128 ]; 129 ];
129 130
130 $request = $this->createMock(Request::class); 131 $request = $this->createMock(Request::class);
@@ -143,7 +144,7 @@ class PluginsControllerTest extends TestCase
143 ->with('save_plugin_parameters', $parameters) 144 ->with('save_plugin_parameters', $parameters)
144 ; 145 ;
145 $this->container->conf 146 $this->container->conf
146 ->expects(static::atLeastOnce()) 147 ->expects(static::exactly(2))
147 ->method('set') 148 ->method('set')
148 ->withConsecutive(['plugins.parameter1', 'blip'], ['plugins.parameter2', 'blop']) 149 ->withConsecutive(['plugins.parameter1', 'blip'], ['plugins.parameter2', 'blop'])
149 ; 150 ;