From: ArthurHoaro Date: Sun, 8 Nov 2015 11:00:06 +0000 (+0100) Subject: unit tests for the wallabag plugin X-Git-Tag: v0.6.0~3^2~2^2 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=sidebyside;h=1696f6aa07734c7502702cf810c9fdc93532ef56;p=github%2Fshaarli%2FShaarli.git unit tests for the wallabag plugin + removed exit error if the config is not found + coding style --- diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index db8151c9..024a3d2b 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)); + } +}