summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-03-23 08:33:49 +0100
committerChristian Weiske <cweiske@cweiske.de>2011-03-23 08:33:49 +0100
commit7d31d9d1654bf5bdb1765397bb7bfd1a85c770a7 (patch)
treec037bd87854a90560284afa6ce9b1b0c13711d7a /tests
parentd4ccb1d3d3abf433200b39e8a5566a71bb1e6c2b (diff)
downloadsemanticscuttle-7d31d9d1654bf5bdb1765397bb7bfd1a85c770a7.tar.gz
semanticscuttle-7d31d9d1654bf5bdb1765397bb7bfd1a85c770a7.tar.bz2
test for the days parameter
Diffstat (limited to 'tests')
-rw-r--r--tests/Bookmark2TagTest.php37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/Bookmark2TagTest.php b/tests/Bookmark2TagTest.php
index 6932a10..0fae2ea 100644
--- a/tests/Bookmark2TagTest.php
+++ b/tests/Bookmark2TagTest.php
@@ -286,6 +286,43 @@ class Bookmark2TagTest extends TestBase
$arTags
);
}
+
+
+
+ public function testGetPopularTagsDays()
+ {
+ $user = $this->addUser();
+ $this->addTagBookmark($user, array('one', 'two'), 'today');
+ $this->addTagBookmark($user, array('one', 'three'), 'today');
+ $this->addTagBookmark($user, array('one', 'two'), '-1 day 1 hour');
+ $this->addTagBookmark($user, array('one', 'three'), '-3 days 1 hour');
+
+ $arTags = $this->b2ts->getPopularTags(null, 10, null, 1);
+ $this->assertInternalType('array', $arTags);
+ $this->assertEquals(3, count($arTags));
+ $this->assertContains(array('tag' => 'one', 'bCount' => '2'), $arTags);
+ $this->assertContains(array('tag' => 'two', 'bCount' => '1'), $arTags);
+ $this->assertContains(array('tag' => 'three', 'bCount' => '1'), $arTags);
+
+ $arTags = $this->b2ts->getPopularTags(null, 10, null, 2);
+ $this->assertInternalType('array', $arTags);
+ $this->assertEquals(3, count($arTags));
+ $this->assertEquals(
+ array(
+ array('tag' => 'one', 'bCount' => '3'),
+ array('tag' => 'two', 'bCount' => '2'),
+ array('tag' => 'three', 'bCount' => '1'),
+ ),
+ $arTags
+ );
+
+ $arTags = $this->b2ts->getPopularTags(null, 10, null, 5);
+ $this->assertInternalType('array', $arTags);
+ $this->assertEquals(3, count($arTags));
+ $this->assertContains(array('tag' => 'one', 'bCount' => '4'), $arTags);
+ $this->assertContains(array('tag' => 'two', 'bCount' => '2'), $arTags);
+ $this->assertContains(array('tag' => 'three', 'bCount' => '2'), $arTags);
+ }
}
if (PHPUnit_MAIN_METHOD == 'Bookmark2TagTest::main') {