Private/Hidden tags
Tags starting with a dot '.' are now private. They can only be seen and searched when logged in. Fixes #315
This commit is contained in:
parent
1e7331126d
commit
195acf9f09
4 changed files with 27 additions and 2 deletions
tests
|
@ -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))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -239,7 +239,6 @@ class UpdaterTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude'));
|
||||
$updater = new Updater(array(), self::$configFields, $linkDB, true);
|
||||
$updater->updateMethodRenameDashTags();
|
||||
var_dump($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude'));
|
||||
$this->assertNotEmpty($linkDB->filter(LinkFilter::$FILTER_TAG, 'exclude'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class ReferenceLinkDB
|
|||
'A free software media publishing platform',
|
||||
0,
|
||||
'20130614_184135',
|
||||
'gnu media web'
|
||||
'gnu media web .hidden'
|
||||
);
|
||||
|
||||
$this->addLink(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue