aboutsummaryrefslogtreecommitdiff
path: root/tests/tag2TagTest.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-03-14 15:18:01 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-03-14 15:18:01 +0000
commit146c63e90cd46b727fdc34acb1b224656d81efc5 (patch)
treeb93eff2f2eedf8d3f0736e8edd2a42d3f425e404 /tests/tag2TagTest.php
parentd10c26fd1de42d9d7030f383dc20ac2c17fccbd1 (diff)
downloadsemanticscuttle-146c63e90cd46b727fdc34acb1b224656d81efc5.tar.gz
semanticscuttle-146c63e90cd46b727fdc34acb1b224656d81efc5.tar.bz2
Feature improvement: make rename tags more consistent (with regards to linked tags)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@85 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'tests/tag2TagTest.php')
-rw-r--r--tests/tag2TagTest.php30
1 files changed, 20 insertions, 10 deletions
diff --git a/tests/tag2TagTest.php b/tests/tag2TagTest.php
index ea0adf0..c356be8 100644
--- a/tests/tag2TagTest.php
+++ b/tests/tag2TagTest.php
@@ -430,24 +430,34 @@ class Tag2TagTest extends PHPUnit_Framework_TestCase
$tsts = $this->tsts;
// with classic tags (users 10 & 20)
- $tags = array('a', 'b', 'c');
- $bs->addBookmark("http://site1.com", "title", "description", "status", $tags, null, false, false, 10);
+ $bs->addBookmark("http://site1.com", "title", "description", "status", array('tag1', 'tag11', 'tag111'), null, false, false, 1);
+ $bs->addBookmark("http://site1.com", "title2", "description2", "status", array('tag2', 'tag22', 'tag222'), null, false, false, 2);
- $tags = array('a', 'b', 'c');
- $bs->addBookmark("http://site2.com", "title", "description", "status", $tags, null, false, false, 20);
+ $bookmarks =& $bs->getBookmarks(0, 1, NULL, NULL, NULL, getSortOrder(), NULL, 0, $dtend);
+ $this->assertEquals(1, $bookmarks['total']);
- $bookmarks = $bs->getBookmarks(0, NULL, 10, 'a');
- $this->assertSame(array(), $bookmarks);
-
- $ts->renameTag(10, 'a', 'ddd');
+ $ts->renameTag(1, 'tag1', 'newtag1');
$tags1 = $ts->getTagsForBookmark(1);
- $this->assertSame(array('b', 'c', 'ddd'), $tags1);
+ $this->assertSame(array('newtag1', 'tag11', 'tag111'), $tags1);
+ $tags1 = $ts->getTagsForBookmark(2);
+ $this->assertSame(array('tag2', 'tag22', 'tag222'), $tags1); //should not be changed
// with linked tags
$tts->addLinkedTags('b', 'c', '>', 1);
- $tts->addLinkedTags('a', 'd', '>', 1);
+ $tts->addLinkedTags('a', 'b', '>', 1);
+ $tts->addLinkedTags('b', 'a', '>', 2); // should not be modified because of userid
+
+ $tts->renameTag(1, 'b', 'e');
+ $linkedTags = $tts->getLinkedTags('e', '>', 1);
+ $this->assertSame(array('c'), $linkedTags);
+ $linkedTags = $tts->getLinkedTags('a', '>', 1);
+ $this->assertSame(array('e'), $linkedTags);
+ $linkedTags = $tts->getLinkedTags('b', '>', 2);
+ $this->assertSame(array('a'), $linkedTags);
+
+
//with stats