diff options
Diffstat (limited to 'tests/bookmark/LinkUtilsTest.php')
-rw-r--r-- | tests/bookmark/LinkUtilsTest.php | 20 |
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. |