aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2019-02-09 14:13:08 +0100
committerArthurHoaro <arthur@hoa.ro>2019-02-24 12:25:50 +0100
commita8e7da01146455f13ef06b151a7dafedd3acf769 (patch)
treeb8278b8fb78fd40183e4273e880b85555358c6de /tests
parent905f8675a728841b03b300d2c7dc909a1c4f7f03 (diff)
downloadShaarli-a8e7da01146455f13ef06b151a7dafedd3acf769.tar.gz
Shaarli-a8e7da01146455f13ef06b151a7dafedd3acf769.tar.zst
Shaarli-a8e7da01146455f13ef06b151a7dafedd3acf769.zip
Do not try to retrieve thumbnails for internal link
Also adds a helper function to determine if a link is a note and apply it across multiple files.
Diffstat (limited to 'tests')
-rw-r--r--tests/bookmark/LinkUtilsTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php
index 1b8688e6..5b31115b 100644
--- a/tests/bookmark/LinkUtilsTest.php
+++ b/tests/bookmark/LinkUtilsTest.php
@@ -318,6 +318,26 @@ class LinkUtilsTest extends \PHPUnit\Framework\TestCase
318 } 318 }
319 319
320 /** 320 /**
321 * Test is_note with note URLs.
322 */
323 public function testIsNote()
324 {
325 $this->assertTrue(is_note('?'));
326 $this->assertTrue(is_note('?abcDEf'));
327 $this->assertTrue(is_note('?_abcDEf#123'));
328 }
329
330 /**
331 * Test is_note with non note URLs.
332 */
333 public function testIsNotNote()
334 {
335 $this->assertFalse(is_note(''));
336 $this->assertFalse(is_note('nope'));
337 $this->assertFalse(is_note('https://github.com/shaarli/Shaarli/?hi'));
338 }
339
340 /**
321 * Util function to build an hashtag link. 341 * Util function to build an hashtag link.
322 * 342 *
323 * @param string $hashtag Hashtag name. 343 * @param string $hashtag Hashtag name.