aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkFilterTest.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-05-07 19:17:33 +0200
committerArthurHoaro <arthur@hoa.ro>2017-05-07 19:17:33 +0200
commit01e942d44c7194607649817216aeb5d65c6acad6 (patch)
tree15777aa1005251f119e6dd680291147117766b5b /tests/LinkFilterTest.php
parentbc22c9a0acb095970e9494cbe8954f0612e05dc0 (diff)
parent8868f3ca461011a8fb6dd9f90b60ed697ab52fc5 (diff)
downloadShaarli-01e942d44c7194607649817216aeb5d65c6acad6.tar.gz
Shaarli-01e942d44c7194607649817216aeb5d65c6acad6.tar.zst
Shaarli-01e942d44c7194607649817216aeb5d65c6acad6.zip
Merge tag 'v0.8.4' into stable
Release v0.8.4
Diffstat (limited to 'tests/LinkFilterTest.php')
-rw-r--r--tests/LinkFilterTest.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/tests/LinkFilterTest.php b/tests/LinkFilterTest.php
index 1620bb78..21d680a5 100644
--- a/tests/LinkFilterTest.php
+++ b/tests/LinkFilterTest.php
@@ -159,7 +159,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
159 159
160 $this->assertEquals( 160 $this->assertEquals(
161 'MediaGoblin', 161 'MediaGoblin',
162 $links['20130614_184135']['title'] 162 $links[7]['title']
163 ); 163 );
164 } 164 }
165 165
@@ -286,7 +286,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
286 ); 286 );
287 287
288 $this->assertEquals( 288 $this->assertEquals(
289 6, 289 7,
290 count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '-revolution')) 290 count(self::$linkFilter->filter(LinkFilter::$FILTER_TEXT, '-revolution'))
291 ); 291 );
292 } 292 }
@@ -346,7 +346,7 @@ class LinkFilterTest extends PHPUnit_Framework_TestCase
346 ); 346 );
347 347
348 $this->assertEquals( 348 $this->assertEquals(
349 6, 349 7,
350 count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, '-free')) 350 count(self::$linkFilter->filter(LinkFilter::$FILTER_TAG, '-free'))
351 ); 351 );
352 } 352 }
@@ -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}