From 1696f6aa07734c7502702cf810c9fdc93532ef56 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 8 Nov 2015 12:00:06 +0100 Subject: unit tests for the wallabag plugin + removed exit error if the config is not found + coding style --- tests/plugins/PluginWallabagTest.php | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 tests/plugins/PluginWallabagTest.php (limited to 'tests') diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php new file mode 100644 index 00000000..7cc83f4f --- /dev/null +++ b/tests/plugins/PluginWallabagTest.php @@ -0,0 +1,49 @@ + $str, + 'links' => array( + array( + 'url' => $str, + ) + ) + ); + + $data = hook_wallabag_render_linklist($data); + $link = $data['links'][0]; + // data shouldn't be altered + $this->assertEquals($str, $data['title']); + $this->assertEquals($str, $link['url']); + + // plugin data + $this->assertEquals(1, count($link['link_plugin'])); + $this->assertNotFalse(strpos($link['link_plugin'][0], $str)); + } +} -- cgit v1.2.3