aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-10-17 08:50:18 +0200
committerGitHub <noreply@github.com>2016-10-17 08:50:18 +0200
commit06eec9bf764662cd328627247a1f43e4abd3c5ad (patch)
treefd66a3e1cb4cd93aa80b6f04c43958623140a008 /tests
parentbb70e690598d270951148e003a4dc253b05868b4 (diff)
parent7fde6de1212323418401c15efba06026c704ca87 (diff)
downloadShaarli-06eec9bf764662cd328627247a1f43e4abd3c5ad.tar.gz
Shaarli-06eec9bf764662cd328627247a1f43e4abd3c5ad.tar.zst
Shaarli-06eec9bf764662cd328627247a1f43e4abd3c5ad.zip
Merge pull request #659 from ArthurHoaro/plugin-errors
New init function for plugins, supports errors reporting
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/PluginReadityourselfTest.php23
-rw-r--r--tests/plugins/PluginWallabagTest.php23
2 files changed, 42 insertions, 4 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()
diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php
index 302ee296..2c268cbd 100644
--- a/tests/plugins/PluginWallabagTest.php
+++ b/tests/plugins/PluginWallabagTest.php
@@ -4,8 +4,6 @@
4 * PluginWallabagTest.php.php 4 * PluginWallabagTest.php.php
5 */ 5 */
6 6
7// FIXME! add an init method.
8$conf = new ConfigManager('');
9require_once 'plugins/wallabag/wallabag.php'; 7require_once 'plugins/wallabag/wallabag.php';
10 8
11/** 9/**
@@ -23,6 +21,27 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase
23 } 21 }
24 22
25 /** 23 /**
24 * Test wallabag init without errors.
25 */
26 function testWallabagInitNoError()
27 {
28 $conf = new ConfigManager('');
29 $conf->set('plugins.WALLABAG_URL', 'value');
30 $errors = wallabag_init($conf);
31 $this->assertEmpty($errors);
32 }
33
34 /**
35 * Test wallabag init with errors.
36 */
37 function testWallabagInitError()
38 {
39 $conf = new ConfigManager('');
40 $errors = wallabag_init($conf);
41 $this->assertNotEmpty($errors);
42 }
43
44 /**
26 * Test render_linklist hook. 45 * Test render_linklist hook.
27 */ 46 */
28 function testWallabagLinklist() 47 function testWallabagLinklist()