'media' => 1,
'software' => 1,
'stallman' => 1,
- 'free' => 1
+ 'free' => 1,
+ '-exclude' => 1,
),
self::$publicLinkDB->allTags()
);
'html' => 1,
'w3c' => 1,
'css' => 1,
- 'Mercurial' => 1
+ 'Mercurial' => 1,
+ '-exclude' => 1,
+ '.hidden' => 1,
),
self::$privateLinkDB->allTags()
);
count(self::$privateLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false))
);
}
+
+ /**
+ * Test hidden tags feature:
+ * tags starting with a dot '.' are only visible when logged in.
+ */
+ public function testHiddenTags()
+ {
+ $tags = '.hidden';
+ $this->assertEquals(
+ 1,
+ count(self::$privateLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false))
+ );
+
+ $this->assertEquals(
+ 0,
+ count(self::$publicLinkDB->filter(LinkFilter::$FILTER_TAG, $tags, true, false))
+ );
+ }
}