aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins/PluginWallabagTest.php
diff options
context:
space:
mode:
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