X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fconfig%2FConfigPluginTest.php;h=fa72d8c4ae40438ccdac5af72c3734cd192fb0b5;hb=a5a9cf23acd1248585173aa32757d9720b5f2d62;hp=22ab927b084e8d9b26d1a0fe64c48178fcd39fa7;hpb=3c66e56435359dc678048193e8ee239d06f79b64;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/config/ConfigPluginTest.php b/tests/config/ConfigPluginTest.php index 22ab927b..fa72d8c4 100644 --- a/tests/config/ConfigPluginTest.php +++ b/tests/config/ConfigPluginTest.php @@ -1,16 +1,15 @@ 2, // no plugin related 'plugin2' => 0, // new - at the end 'plugin3' => 0, // 2nd 'order_plugin3' => 8, 'plugin4' => 0, // 1st 'order_plugin4' => 5, - ); + ]; - $expected = array( + $expected = [ 'plugin3', 'plugin4', 'plugin2', - ); + ]; + + mkdir($path = __DIR__ . '/folder'); + PluginManager::$PLUGINS_PATH = $path; + array_map(function (string $plugin) use ($path) { touch($path . '/' . $plugin); }, $expected); $out = save_plugin_config($data); $this->assertEquals($expected, $out); + + array_map(function (string $plugin) use ($path) { unlink($path . '/' . $plugin); }, $expected); + rmdir($path); } /** * Test save_plugin_config with invalid data. - * - * @expectedException Shaarli\Config\PluginConfigOrderException */ public function testSavePluginConfigInvalid() { + $this->expectException(\Shaarli\Config\Exception\PluginConfigOrderException::class); + $data = array( 'plugin2' => 0, 'plugin3' => 0,