aboutsummaryrefslogtreecommitdiff
path: root/tests/Bookmark2TagTest.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-08-01 19:58:39 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-08-01 19:58:39 +0200
commit8216ae476c25960f0480233c35af9feb257563a5 (patch)
tree8f745af62719656b7cf084853719d0e49e6d2ade /tests/Bookmark2TagTest.php
parent81aa17b8523d95310c90366d9af09767db0c84f2 (diff)
parent4775d7bf5adfcc3bd965f2190505f7e543557c39 (diff)
downloadsemanticscuttle-8216ae476c25960f0480233c35af9feb257563a5.tar.gz
semanticscuttle-8216ae476c25960f0480233c35af9feb257563a5.tar.bz2
Merge branch '0.98'
Conflicts: doc/ChangeLog
Diffstat (limited to 'tests/Bookmark2TagTest.php')
-rw-r--r--tests/Bookmark2TagTest.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/Bookmark2TagTest.php b/tests/Bookmark2TagTest.php
index 0236a5f..4d95d69 100644
--- a/tests/Bookmark2TagTest.php
+++ b/tests/Bookmark2TagTest.php
@@ -500,6 +500,31 @@ class Bookmark2TagTest extends TestBase
$this->assertContains(array('tag' => 'thr', 'bCount' => '1'), $arTags);
}
+ /**
+ * Should return the logged on user's public, protected and private tags
+ * as well as public ones of other specified users.
+ *
+ * @covers SemanticScuttle_Service_Bookmark2Tag::getPopularTags
+ */
+ public function testGetPopularTagsUserPrivatesAndOthersWhenLoggedIn()
+ {
+ $user1 = $this->addUser();
+ $user2 = $this->addUser();
+ $this->addBookmark($user1, null, 0, array('one'));
+ $this->addBookmark($user1, null, 1, array('one', 'two'));
+ $this->addBookmark($user1, null, 2, array('thr'));
+ $this->addBookmark($user2, null, 0, array('fou'));
+ $this->addBookmark($user2, null, 1, array('fiv'));
+ $this->addBookmark($user2, null, 2, array('six'));
+
+ $arTags = $this->b2ts->getPopularTags(array($user2, $user1), 10, $user1);
+ $this->assertContains(array('tag' => 'one', 'bCount' => '2'), $arTags);
+ $this->assertContains(array('tag' => 'two', 'bCount' => '1'), $arTags);
+ $this->assertContains(array('tag' => 'thr', 'bCount' => '1'), $arTags);
+ $this->assertContains(array('tag' => 'fou', 'bCount' => '1'), $arTags);
+ $this->assertEquals(4, count($arTags));
+ }
+
/**
* @covers SemanticScuttle_Service_Bookmark2Tag::getAdminTags