aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/LinkDBTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/LinkDBTest.php')
-rw-r--r--tests/LinkDBTest.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php
index 3b1a2057..765f771e 100644
--- a/tests/LinkDBTest.php
+++ b/tests/LinkDBTest.php
@@ -276,7 +276,8 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
276 'media' => 1, 276 'media' => 1,
277 'software' => 1, 277 'software' => 1,
278 'stallman' => 1, 278 'stallman' => 1,
279 'free' => 1 279 'free' => 1,
280 '-exclude' => 1,
280 ), 281 ),
281 self::$publicLinkDB->allTags() 282 self::$publicLinkDB->allTags()
282 ); 283 );
@@ -295,7 +296,9 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
295 'html' => 1, 296 'html' => 1,
296 'w3c' => 1, 297 'w3c' => 1,
297 'css' => 1, 298 'css' => 1,
298 'Mercurial' => 1 299 'Mercurial' => 1,
300 '-exclude' => 1,
301 '.hidden' => 1,
299 ), 302 ),
300 self::$privateLinkDB->allTags() 303 self::$privateLinkDB->allTags()
301 ); 304 );
@@ -347,4 +350,22 @@ class LinkDBTest extends PHPUnit_Framework_TestCase
347 count(self::$privateLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false)) 350 count(self::$privateLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false))
348 ); 351 );
349 } 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 }
350} 371}