X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fplugins%2FPluginWallabagTest.php;fp=tests%2Fplugins%2FPluginWallabagTest.php;h=9a402fb75a177fd585c65778f9322d811f74adcf;hb=1409f1c89a7ca01456ae2dcd6357d296e2b99f5a;hp=36317215976e4a5c38fe8bf721525b903d764d8d;hpb=054e03f37fa29da8066f1a637919f13c7e7dc5d2;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php index 36317215..9a402fb7 100644 --- a/tests/plugins/PluginWallabagTest.php +++ b/tests/plugins/PluginWallabagTest.php @@ -49,14 +49,15 @@ class PluginWallabagTest extends \Shaarli\TestCase $conf = new ConfigManager(''); $conf->set('plugins.WALLABAG_URL', 'value'); $str = 'http://randomstr.com/test'; - $data = array( + $data = [ 'title' => $str, - 'links' => array( - array( + 'links' => [ + [ 'url' => $str, - ) - ) - ); + ] + ], + '_LOGGEDIN_' => true, + ]; $data = hook_wallabag_render_linklist($data, $conf); $link = $data['links'][0]; @@ -69,4 +70,26 @@ class PluginWallabagTest extends \Shaarli\TestCase $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str))); $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL'))); } + + /** + * Test render_linklist hook while logged out: no change. + */ + public function testWallabagLinklistLoggedOut(): void + { + $conf = new ConfigManager(''); + $str = 'http://randomstr.com/test'; + $data = [ + 'title' => $str, + 'links' => [ + [ + 'url' => $str, + ] + ], + '_LOGGEDIN_' => false, + ]; + + $result = hook_wallabag_render_linklist($data, $conf); + + static::assertSame($data, $result); + } }