From 9ccca40189652e529732683abcdf54fcf775c9ec Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 10 May 2016 23:18:04 +0200 Subject: Hashtag system * Hashtag are auto-linked with a filter search * Supports unicode * Compatible with markdown (excluded in code blocks) --- tests/LinkFilterTest.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests/LinkFilterTest.php') diff --git a/tests/LinkFilterTest.php b/tests/LinkFilterTest.php index 1620bb78..7d45fc59 100644 --- a/tests/LinkFilterTest.php +++ b/tests/LinkFilterTest.php @@ -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 + )) + ); + } } -- cgit v1.2.3