aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins/PluginReadityourselfTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-10-14 13:22:58 +0200
committerArthurHoaro <arthur@hoa.ro>2016-11-05 14:30:13 +0100
commitbaec9c402873a716497b591b9756bf5b2c46ed9b (patch)
tree33ae9c12bdcce378ca08973f553df15a50c00e8c /tests/plugins/PluginReadityourselfTest.php
parentb3c039b02f9608802d0ba2cf5b5742caa3b9d430 (diff)
downloadShaarli-baec9c402873a716497b591b9756bf5b2c46ed9b.tar.gz
Shaarli-baec9c402873a716497b591b9756bf5b2c46ed9b.tar.zst
Shaarli-baec9c402873a716497b591b9756bf5b2c46ed9b.zip
New init function for plugins, supports errors reporting
All plugins can optionally add an init function named `pluginname_init()` which is called when the plugin is loaded. This function is aware of the config, and can return initialization errors, which are displayed in the header template. Note that the previous error system hack no longer work.
Diffstat (limited to 'tests/plugins/PluginReadityourselfTest.php')
-rw-r--r--tests/plugins/PluginReadityourselfTest.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/plugins/PluginReadityourselfTest.php b/tests/plugins/PluginReadityourselfTest.php
index d73e666a..532db146 100644
--- a/tests/plugins/PluginReadityourselfTest.php
+++ b/tests/plugins/PluginReadityourselfTest.php
@@ -4,8 +4,6 @@
4 * PluginReadityourselfTest.php.php 4 * PluginReadityourselfTest.php.php
5 */ 5 */
6 6
7// FIXME! add an init method.
8$conf = new ConfigManager('');
9require_once 'plugins/readityourself/readityourself.php'; 7require_once 'plugins/readityourself/readityourself.php';
10 8
11/** 9/**
@@ -23,6 +21,27 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase
23 } 21 }
24 22
25 /** 23 /**
24 * Test Readityourself init without errors.
25 */
26 function testReadityourselfInitNoError()
27 {
28 $conf = new ConfigManager('');
29 $conf->set('plugins.READITYOUSELF_URL', 'value');
30 $errors = readityourself_init($conf);
31 $this->assertEmpty($errors);
32 }
33
34 /**
35 * Test Readityourself init with errors.
36 */
37 function testReadityourselfInitError()
38 {
39 $conf = new ConfigManager('');
40 $errors = readityourself_init($conf);
41 $this->assertNotEmpty($errors);
42 }
43
44 /**
26 * Test render_linklist hook. 45 * Test render_linklist hook.
27 */ 46 */
28 function testReadityourselfLinklist() 47 function testReadityourselfLinklist()