diff options
Diffstat (limited to 'tests/front/controller/admin/PluginsControllerTest.php')
-rw-r--r-- | tests/front/controller/admin/PluginsControllerTest.php | 7 |
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 | ||
5 | namespace Shaarli\Front\Controller\Admin; | 5 | namespace Shaarli\Front\Controller\Admin; |
6 | 6 | ||
7 | use PHPUnit\Framework\TestCase; | ||
8 | use Shaarli\Config\ConfigManager; | 7 | use Shaarli\Config\ConfigManager; |
9 | use Shaarli\Front\Exception\WrongTokenException; | 8 | use Shaarli\Front\Exception\WrongTokenException; |
10 | use Shaarli\Plugin\PluginManager; | 9 | use Shaarli\Plugin\PluginManager; |
11 | use Shaarli\Security\SessionManager; | 10 | use Shaarli\Security\SessionManager; |
11 | use Shaarli\TestCase; | ||
12 | use Slim\Http\Request; | 12 | use Slim\Http\Request; |
13 | use Slim\Http\Response; | 13 | use 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 | ; |