]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/bookmark/LinkUtilsTest.php
Merge pull request #1271 from ArthurHoaro/hotfix/thumb-note-retrieve
[github/shaarli/Shaarli.git] / tests / bookmark / LinkUtilsTest.php
index bd08f03670a68cba16bea8895a906b35c5b953ec..25fb30435c8ef09c91623f6b416c1b6300ff459e 100644 (file)
@@ -288,6 +288,26 @@ class LinkUtilsTest extends \PHPUnit\Framework\TestCase
         $this->assertNotContains('>#nothashtag', $autolinkedDescription);
     }
 
+    /**
+     * Test is_note with note URLs.
+     */
+    public function testIsNote()
+    {
+        $this->assertTrue(is_note('?'));
+        $this->assertTrue(is_note('?abcDEf'));
+        $this->assertTrue(is_note('?_abcDEf#123'));
+    }
+
+    /**
+     * Test is_note with non note URLs.
+     */
+    public function testIsNotNote()
+    {
+        $this->assertFalse(is_note(''));
+        $this->assertFalse(is_note('nope'));
+        $this->assertFalse(is_note('https://github.com/shaarli/Shaarli/?hi'));
+    }
+
     /**
      * Util function to build an hashtag link.
      *