X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FLinkFilterTest.php;h=7d45fc59c985af654365646c2767bf4e08936a5f;hb=954dc2446caade6ccad3ffd1173ef139c1f36ad3;hp=1620bb78e91ee945b31deffb3fde1dd32bb5b033;hpb=528a6f8a232c060faf024008e4f8a09b4aa8dabc;p=github%2Fshaarli%2FShaarli.git 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 + )) + ); + } }