diff options
author | ArthurHoaro <arthur@hoa.ro> | 2016-05-10 23:18:04 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2016-06-06 21:04:43 +0200 |
commit | 9ccca40189652e529732683abcdf54fcf775c9ec (patch) | |
tree | 9deda85d287dcba664bbba2f0bf9228e6118fbad /tests/LinkFilterTest.php | |
parent | bb9ca54838e2f877635197541e8439171c83d5dc (diff) | |
download | Shaarli-9ccca40189652e529732683abcdf54fcf775c9ec.tar.gz Shaarli-9ccca40189652e529732683abcdf54fcf775c9ec.tar.zst Shaarli-9ccca40189652e529732683abcdf54fcf775c9ec.zip |
Hashtag system
* Hashtag are auto-linked with a filter search
* Supports unicode
* Compatible with markdown (excluded in code blocks)
Diffstat (limited to 'tests/LinkFilterTest.php')
-rw-r--r-- | tests/LinkFilterTest.php | 26 |
1 files changed, 26 insertions, 0 deletions
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 | |||
387 | )) | 387 | )) |
388 | ); | 388 | ); |
389 | } | 389 | } |
390 | |||
391 | /** | ||
392 | * Filter links by #hashtag. | ||
393 | */ | ||
394 | public function testFilterByHashtag() | ||
395 | { | ||
396 | $hashtag = 'hashtag'; | ||
397 | $this->assertEquals( | ||
398 | 3, | ||
399 | count(self::$linkFilter->filter( | ||
400 | LinkFilter::$FILTER_TAG, | ||
401 | $hashtag | ||
402 | )) | ||
403 | ); | ||
404 | |||
405 | $hashtag = 'private'; | ||
406 | $this->assertEquals( | ||
407 | 1, | ||
408 | count(self::$linkFilter->filter( | ||
409 | LinkFilter::$FILTER_TAG, | ||
410 | $hashtag, | ||
411 | false, | ||
412 | true | ||
413 | )) | ||
414 | ); | ||
415 | } | ||
390 | } | 416 | } |