]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/LinkFilterTest.php
Hashtag system
[github/shaarli/Shaarli.git] / tests / LinkFilterTest.php
index 1620bb78e91ee945b31deffb3fde1dd32bb5b033..7d45fc59c985af654365646c2767bf4e08936a5f 100644 (file)
@@ -387,4 +387,30 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
             ))
         );
     }
+
+    /**
+     * Filter links by #hashtag.
+     */
+    public function testFilterByHashtag()
+    {
+        $hashtag = 'hashtag';
+        $this->assertEquals(
+            3,
+            count(self::$linkFilter->filter(
+                LinkFilter::$FILTER_TAG,
+                $hashtag
+            ))
+        );
+
+        $hashtag = 'private';
+        $this->assertEquals(
+            1,
+            count(self::$linkFilter->filter(
+                LinkFilter::$FILTER_TAG,
+                $hashtag,
+                false,
+                true
+            ))
+        );
+    }
 }