diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-11-03 11:46:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-03 11:46:54 +0100 |
commit | 38b55fbf3d4fdb515d0e82e5a3126d4671652b3e (patch) | |
tree | edb65474ec46a3aeb9897b4f42fc5e205718c774 /tests/plugins | |
parent | b7ec15790e88959d8026df8a5e68e523d03522c7 (diff) | |
parent | 358cb20bcba3cb7b0ce2a3000fb7026465a10386 (diff) | |
download | Shaarli-38b55fbf3d4fdb515d0e82e5a3126d4671652b3e.tar.gz Shaarli-38b55fbf3d4fdb515d0e82e5a3126d4671652b3e.tar.zst Shaarli-38b55fbf3d4fdb515d0e82e5a3126d4671652b3e.zip |
Merge pull request #1610 from ArthurHoaro/fix/wallabag
Plugin wallabag: minor improvements
Diffstat (limited to 'tests/plugins')
-rw-r--r-- | tests/plugins/PluginWallabagTest.php | 35 |
1 files changed, 29 insertions, 6 deletions
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 | |||
49 | $conf = new ConfigManager(''); | 49 | $conf = new ConfigManager(''); |
50 | $conf->set('plugins.WALLABAG_URL', 'value'); | 50 | $conf->set('plugins.WALLABAG_URL', 'value'); |
51 | $str = 'http://randomstr.com/test'; | 51 | $str = 'http://randomstr.com/test'; |
52 | $data = array( | 52 | $data = [ |
53 | 'title' => $str, | 53 | 'title' => $str, |
54 | 'links' => array( | 54 | 'links' => [ |
55 | array( | 55 | [ |
56 | 'url' => $str, | 56 | 'url' => $str, |
57 | ) | 57 | ] |
58 | ) | 58 | ], |
59 | ); | 59 | '_LOGGEDIN_' => true, |
60 | ]; | ||
60 | 61 | ||
61 | $data = hook_wallabag_render_linklist($data, $conf); | 62 | $data = hook_wallabag_render_linklist($data, $conf); |
62 | $link = $data['links'][0]; | 63 | $link = $data['links'][0]; |
@@ -69,4 +70,26 @@ class PluginWallabagTest extends \Shaarli\TestCase | |||
69 | $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str))); | 70 | $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str))); |
70 | $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL'))); | 71 | $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL'))); |
71 | } | 72 | } |
73 | |||
74 | /** | ||
75 | * Test render_linklist hook while logged out: no change. | ||
76 | */ | ||
77 | public function testWallabagLinklistLoggedOut(): void | ||
78 | { | ||
79 | $conf = new ConfigManager(''); | ||
80 | $str = 'http://randomstr.com/test'; | ||
81 | $data = [ | ||
82 | 'title' => $str, | ||
83 | 'links' => [ | ||
84 | [ | ||
85 | 'url' => $str, | ||
86 | ] | ||
87 | ], | ||
88 | '_LOGGEDIN_' => false, | ||
89 | ]; | ||
90 | |||
91 | $result = hook_wallabag_render_linklist($data, $conf); | ||
92 | |||
93 | static::assertSame($data, $result); | ||
94 | } | ||
72 | } | 95 | } |