summaryrefslogtreecommitdiff
path: root/tests/Api/PostsAddTest.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-13 06:57:54 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-13 06:57:54 +0200
commit803b83fb7d051593066b5224a59fbf3ec6efc824 (patch)
tree173c97393f9e211b05f8c73793c180a1b88799b0 /tests/Api/PostsAddTest.php
parentfbfbd8d5cae579058b5d31b97c062cefd9bb36b6 (diff)
parent88d7b9631b444cef28115fb8e0bae736b45e557e (diff)
downloadsemanticscuttle-803b83fb7d051593066b5224a59fbf3ec6efc824.tar.gz
semanticscuttle-803b83fb7d051593066b5224a59fbf3ec6efc824.tar.bz2
Merge branch 'master' into ssl-client-certs
Diffstat (limited to 'tests/Api/PostsAddTest.php')
-rw-r--r--tests/Api/PostsAddTest.php48
1 files changed, 47 insertions, 1 deletions
diff --git a/tests/Api/PostsAddTest.php b/tests/Api/PostsAddTest.php
index 53aa8e7..02e2b38 100644
--- a/tests/Api/PostsAddTest.php
+++ b/tests/Api/PostsAddTest.php
@@ -406,5 +406,51 @@ TXT;
$this->assertEquals(1, $data['total']);
$this->assertEquals($title2, $data['bookmarks'][0]['bTitle']);
}
+
+
+ /**
+ * Test that a default privacy setting of 2 (Private) is used in adding
+ * a bookmark.
+ */
+ public function testDefaultPrivacyPrivate()
+ {
+ $this->setUnittestConfig(
+ array('defaults' => array('privacy' => 2))
+ );
+ list($req, $uId) = $this->getAuthRequest('?unittestMode=1');
+ $req->setMethod(HTTP_Request2::METHOD_POST);
+ $req->addPostParameter('url', 'http://www.example.org/testdefaultprivacyposts_addprivate');
+ $req->addPostParameter('description', 'Test bookmark 1 for default privacy.');
+ $req->send();
+ $this->us->setCurrentUserId($uId);
+ $bms = $this->bs->getBookmarks(0, null, $uId);
+ $this->assertEquals(1, count($bms['bookmarks']));
+ $bm = reset($bms['bookmarks']);
+ $this->assertEquals('2', $bm['bStatus']);
+ }//end testDefaultPrivacyPrivate
+
+
+ /**
+ * Test that a default privacy setting of 0 (Public) is used in adding
+ * a bookmark.
+ */
+ public function testDefaultPrivacyPublic()
+ {
+ $this->setUnittestConfig(
+ array('defaults' => array('privacy' => 0))
+ );
+ list($req, $uId) = $this->getAuthRequest('?unittestMode=1');
+ $req->setMethod(HTTP_Request2::METHOD_POST);
+ $req->addPostParameter('url', 'http://www.example.org/testdefaultprivacyposts_addpublic');
+ $req->addPostParameter('description', 'Test bookmark 1 for default privacy.');
+ $req->send();
+ $this->us->setCurrentUserId($uId);
+ $bms = $this->bs->getBookmarks(0, null, $uId);
+ $this->assertEquals(1, count($bms['bookmarks']));
+ $bm = reset($bms['bookmarks']);
+ $this->assertEquals('0', $bm['bStatus']);
+ }//end testDefaultPrivacyPublic
+
+
}
-?> \ No newline at end of file
+?>