4 * PluginWallabagTest.php.php
7 require_once 'plugins/wallabag/wallabag.php';
10 * Class PluginWallabagTest
11 * Unit test for the Wallabag plugin
13 class PluginWallabagTest
extends PHPUnit_Framework_TestCase
20 PluginManager
::$PLUGINS_PATH = 'plugins';
24 * Test render_linklist hook.
26 function testWallabagLinklist()
28 $conf = ConfigManager
::getInstance();
29 $conf->set('plugins.WALLABAG_URL', 'value');
30 $str = 'http://randomstr.com/test';
40 $data = hook_wallabag_render_linklist($data);
41 $link = $data['links'][0];
42 // data shouldn't be altered
43 $this->assertEquals($str, $data['title']);
44 $this->assertEquals($str, $link['url']);
47 $this->assertEquals(1, count($link['link_plugin']));
48 $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str)));
49 $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL')));