]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/bookmark/LinkUtilsTest.php
Do not try to retrieve thumbnails for internal link
[github/shaarli/Shaarli.git] / tests / bookmark / LinkUtilsTest.php
index 1b8688e6d398fc1381e6b2acc586ae2562c282f2..5b31115bf50aa570937c62123922205fda1b7950 100644 (file)
@@ -317,6 +317,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.
      *