X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2FLinkDBTest.php;h=765f771ec5381c1cbf8f3fe21843fc892488e566;hb=refs%2Fpull%2F447%2Fhead;hp=06edea79201a2fe18ea53cf9a7277b95153b055e;hpb=1e7331126d81a5759ab91c221f7e0f164aeebfb5;p=github%2Fshaarli%2FShaarli.git 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 'css' => 1, 'Mercurial' => 1, '-exclude' => 1, + '.hidden' => 1, ), self::$privateLinkDB->allTags() ); @@ -349,4 +350,22 @@ class LinkDBTest extends PHPUnit_Framework_TestCase 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)) + ); + } }