From 9866b40814a120f1a019f9f2c8ef66f44e1ddfcb Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Tue, 2 Aug 2016 10:34:21 +0200 Subject: Better whitespace handling in tags Correct PR #573 to work properly with hidden tags, and add ReferenceLinkDB UT. Fixes #571 - Closes #573 --- tests/LinkDBTest.php | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'tests/LinkDBTest.php') diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index e413928a..31306069 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php @@ -317,6 +317,10 @@ class LinkDBTest extends PHPUnit_Framework_TestCase '-exclude' => 1, '.hidden' => 1, 'hashtag' => 2, + 'tag1' => 1, + 'tag2' => 1, + 'tag3' => 1, + 'tag4' => 1, ), self::$privateLinkDB->allTags() ); @@ -429,30 +433,4 @@ class LinkDBTest extends PHPUnit_Framework_TestCase { self::$publicLinkDB->filterHash(''); } - - /** - * test whitespace handling in tags. - * split on whitespace runs and don't allow empty tags. - */ - public function testReadTagsWithWhitespace() - { - // test load contains "tags": " tag1 tag2 tag3 tag4 " - $ds = ''; - file_put_contents(self::$testDatastore, $ds); - self::$publicLinkDB = new LinkDB(self::$testDatastore, false, false); - - $this->assertEquals( - array( - 'tag1' => 1, - 'tag2' => 1, - 'tag3' => 1, - 'tag4' => 1 - ), - self::$publicLinkDB->allTags() - ); - } } -- cgit v1.2.3