aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins/PluginWallabagTest.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-07-09 07:19:48 +0200
committerGitHub <noreply@github.com>2016-07-09 07:19:48 +0200
commit649af5b501d2a90448242f53764ff693e9854039 (patch)
tree23cde80a7ee2949e552c48939ae22fa462cfa0fc /tests/plugins/PluginWallabagTest.php
parenta9cfa38df92bd2e1e2c00a67b6ac1516a2116ade (diff)
parent5ff23f02b80ec6ddee28dee869171ee8e3656b7c (diff)
downloadShaarli-649af5b501d2a90448242f53764ff693e9854039.tar.gz
Shaarli-649af5b501d2a90448242f53764ff693e9854039.tar.zst
Shaarli-649af5b501d2a90448242f53764ff693e9854039.zip
Merge pull request #570 from ArthurHoaro/config-manager
Introduce a configuration manager
Diffstat (limited to 'tests/plugins/PluginWallabagTest.php')
-rw-r--r--tests/plugins/PluginWallabagTest.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php
index 5d3a60e0..302ee296 100644
--- a/tests/plugins/PluginWallabagTest.php
+++ b/tests/plugins/PluginWallabagTest.php
@@ -4,6 +4,8 @@
4 * PluginWallabagTest.php.php 4 * PluginWallabagTest.php.php
5 */ 5 */
6 6
7// FIXME! add an init method.
8$conf = new ConfigManager('');
7require_once 'plugins/wallabag/wallabag.php'; 9require_once 'plugins/wallabag/wallabag.php';
8 10
9/** 11/**
@@ -25,7 +27,8 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase
25 */ 27 */
26 function testWallabagLinklist() 28 function testWallabagLinklist()
27 { 29 {
28 $GLOBALS['plugins']['WALLABAG_URL'] = 'value'; 30 $conf = new ConfigManager('');
31 $conf->set('plugins.WALLABAG_URL', 'value');
29 $str = 'http://randomstr.com/test'; 32 $str = 'http://randomstr.com/test';
30 $data = array( 33 $data = array(
31 'title' => $str, 34 'title' => $str,
@@ -36,7 +39,7 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase
36 ) 39 )
37 ); 40 );
38 41
39 $data = hook_wallabag_render_linklist($data); 42 $data = hook_wallabag_render_linklist($data, $conf);
40 $link = $data['links'][0]; 43 $link = $data['links'][0];
41 // data shouldn't be altered 44 // data shouldn't be altered
42 $this->assertEquals($str, $data['title']); 45 $this->assertEquals($str, $data['title']);
@@ -45,7 +48,6 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase
45 // plugin data 48 // plugin data
46 $this->assertEquals(1, count($link['link_plugin'])); 49 $this->assertEquals(1, count($link['link_plugin']));
47 $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str))); 50 $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str)));
48 $this->assertNotFalse(strpos($link['link_plugin'][0], $GLOBALS['plugins']['WALLABAG_URL'])); 51 $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL')));
49 } 52 }
50} 53}
51