X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fplugins%2FPluginWallabagTest.php;h=302ee296f023d4f8a97db2270cb08e79d6650e82;hb=e1fd94b545a6783853eeee03264596111fdf767e;hp=7cc83f4f7fc2515e41e1a40bc253a2c91d04eb1e;hpb=fd006c630b64146edc402b68d8503c716f8a55d6;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php index 7cc83f4f..302ee296 100644 --- a/tests/plugins/PluginWallabagTest.php +++ b/tests/plugins/PluginWallabagTest.php @@ -4,6 +4,8 @@ * PluginWallabagTest.php.php */ +// FIXME! add an init method. +$conf = new ConfigManager(''); require_once 'plugins/wallabag/wallabag.php'; /** @@ -25,7 +27,8 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase */ function testWallabagLinklist() { - $GLOBALS['plugins']['WALLABAG_URL'] = 'value'; + $conf = new ConfigManager(''); + $conf->set('plugins.WALLABAG_URL', 'value'); $str = 'http://randomstr.com/test'; $data = array( 'title' => $str, @@ -36,7 +39,7 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase ) ); - $data = hook_wallabag_render_linklist($data); + $data = hook_wallabag_render_linklist($data, $conf); $link = $data['links'][0]; // data shouldn't be altered $this->assertEquals($str, $data['title']); @@ -44,6 +47,7 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase // plugin data $this->assertEquals(1, count($link['link_plugin'])); - $this->assertNotFalse(strpos($link['link_plugin'][0], $str)); + $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str))); + $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL'))); } }