aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/front/controller/admin
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-09-10 14:08:19 +0200
committerArthurHoaro <arthur@hoa.ro>2020-09-12 13:29:34 +0200
commit4ff703e3691e6cb398e8d208c1f54ed61315e0e8 (patch)
treedc70aab63e4b5c0ff88736cec065eed60c94d7d2 /tests/front/controller/admin
parente2dff28b44fafcf11a1db7985c50cd40e6945821 (diff)
downloadShaarli-4ff703e3691e6cb398e8d208c1f54ed61315e0e8.tar.gz
Shaarli-4ff703e3691e6cb398e8d208c1f54ed61315e0e8.tar.zst
Shaarli-4ff703e3691e6cb398e8d208c1f54ed61315e0e8.zip
Plugins: do not save metadata along plugin parameters
Also prevent the token to be saved. Fixes #1550
Diffstat (limited to 'tests/front/controller/admin')
-rw-r--r--tests/front/controller/admin/PluginsControllerTest.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/front/controller/admin/PluginsControllerTest.php b/tests/front/controller/admin/PluginsControllerTest.php
index 5b59285c..9526474c 100644
--- a/tests/front/controller/admin/PluginsControllerTest.php
+++ b/tests/front/controller/admin/PluginsControllerTest.php
@@ -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 ;