aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-02-15 21:22:35 +0100
committerArthur <arthur@hoa.ro>2016-02-15 21:22:35 +0100
commit3a38c95d4232aed4a40f70eb11d26cafc9188bac (patch)
tree351663f03ed606f095b88b2f96ca0ef3d41e7f6a /tests/LinkDBTest.php
parent1e7331126d81a5759ab91c221f7e0f164aeebfb5 (diff)
parent195acf9f0931aa3b1a6db8832ab52a260d11090d (diff)
downloadShaarli-3a38c95d4232aed4a40f70eb11d26cafc9188bac.tar.gz
Shaarli-3a38c95d4232aed4a40f70eb11d26cafc9188bac.tar.zst
Shaarli-3a38c95d4232aed4a40f70eb11d26cafc9188bac.zip
Merge pull request #447 from ArthurHoaro/hidden-tags
Private/Hidden tags
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index 06edea79..765f771e 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -298,6 +298,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
298 'css' => 1, 298 'css' => 1,
299 'Mercurial' => 1, 299 'Mercurial' => 1,
300 '-exclude' => 1, 300 '-exclude' => 1,
301 '.hidden' => 1,
301 ), 302 ),
302 self::$privateLinkDB->allTags() 303 self::$privateLinkDB->allTags()
303 ); 304 );
@@ -349,4 +350,22 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
349 count(self::$privateLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false)) 350 count(self::$privateLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false))
350 ); 351 );
351 } 352 }
353
354 /**
355 * Test hidden tags feature:
356 * tags starting with a dot '.' are only visible when logged in.
357 */
358 public function testHiddenTags()
359 {
360 $tags = '.hidden';
361 $this->assertEquals(
362 1,
363 count(self::$privateLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false))
364 );
365
366 $this->assertEquals(
367 0,
368 count(self::$publicLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false))
369 );
370 }
352} 371}