From 1696f6aa07734c7502702cf810c9fdc93532ef56 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 8 Nov 2015 12:00:06 +0100 Subject: [PATCH] unit tests for the wallabag plugin + removed exit error if the config is not found + coding style --- plugins/wallabag/wallabag.php | 22 +++++++++---- tests/plugins/PluginWallabagTest.php | 49 ++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 tests/plugins/PluginWallabagTest.php diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index db8151c..024a3d2 100644 --- a/plugins/wallabag/wallabag.php +++ b/plugins/wallabag/wallabag.php @@ -1,25 +1,33 @@ $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)); + } +}