aboutsummaryrefslogtreecommitdiff
path: root/tests/Tag2TagTest.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 19:34:10 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-25 19:34:10 +0000
commitf0ec32d89bb86d8af9fef96e1ed63d3dac36a1ee (patch)
tree1db70b5f9116a099e458c3a2e4290a80f48a8090 /tests/Tag2TagTest.php
parent09fffebffe9ab1cf7622aa141150157b0746e20d (diff)
downloadsemanticscuttle-f0ec32d89bb86d8af9fef96e1ed63d3dac36a1ee.tar.gz
semanticscuttle-f0ec32d89bb86d8af9fef96e1ed63d3dac36a1ee.tar.bz2
fix testRename() tag2tag test
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@418 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'tests/Tag2TagTest.php')
-rw-r--r--tests/Tag2TagTest.php33
1 files changed, 25 insertions, 8 deletions
diff --git a/tests/Tag2TagTest.php b/tests/Tag2TagTest.php
index 8a19823..004bbaf 100644
--- a/tests/Tag2TagTest.php
+++ b/tests/Tag2TagTest.php
@@ -464,18 +464,35 @@ class Tag2TagTest extends TestBase
$bs = $this->bs;
$tsts = $this->tsts;
+ $uid1 = $this->addUser();
+ $uid2 = $this->addUser();
+
// with classic tags (users 10 & 20)
- $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);
+ $bid1 = $bs->addBookmark(
+ "http://site1.com", "title", "description", 'note', 0,
+ array('tag1', 'tag11', 'tag111'), null, false, false,
+ $uid1
+ );
+ $bid2 = $bs->addBookmark(
+ "http://site1.com", "title2", "description2", 'note', 0,
+ array('tag2', 'tag22', 'tag222'), null, false, false,
+ $uid2
+ );
- $bookmarks =& $bs->getBookmarks(0, 1, NULL, NULL, NULL, getSortOrder(), NULL, 0, null);
+ $bookmarks = $bs->getBookmarks();
$this->assertEquals(1, $bookmarks['total']);
- $b2ts->renameTag(1, 'tag1', 'newtag1');
- $tags1 = $b2ts->getTagsForBookmark(1);
- $this->assertSame(array('newtag1', 'tag11', 'tag111'), $tags1);
- $tags1 = $b2ts->getTagsForBookmark(2);
- $this->assertSame(array('tag2', 'tag22', 'tag222'), $tags1); //should not be changed
+ $b2ts->renameTag($uid1, 'tag1', 'newtag1');
+ $tags1 = $b2ts->getTagsForBookmark($bid1);
+ $this->assertContains('newtag1', $tags1);
+ $this->assertContains('tag11', $tags1);
+ $this->assertContains('tag111', $tags1);
+
+ //should not be changed
+ $tags2 = $b2ts->getTagsForBookmark($bid2);
+ $this->assertContains('tag2', $tags2);
+ $this->assertContains('tag22', $tags2);
+ $this->assertContains('tag222', $tags2);
// with linked tags