aboutsummaryrefslogtreecommitdiff
path: root/tests/Api/PostsAddTest.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-06 09:52:02 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-06 09:52:02 +0200
commit200cb1d3c54dfaae54d26c0d51f6086435bcee8e (patch)
treee92ef6a72d258343928211f257fce69893738e29 /tests/Api/PostsAddTest.php
parent3306261b3ee6ee3df2d67f2f87b4d8afafd55a53 (diff)
downloadsemanticscuttle-200cb1d3c54dfaae54d26c0d51f6086435bcee8e.tar.gz
semanticscuttle-200cb1d3c54dfaae54d26c0d51f6086435bcee8e.tar.bz2
move privacy tests for api/post_add to the correct location
Diffstat (limited to 'tests/Api/PostsAddTest.php')
-rw-r--r--tests/Api/PostsAddTest.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/Api/PostsAddTest.php b/tests/Api/PostsAddTest.php
index 226a7c9..f3bb31e 100644
--- a/tests/Api/PostsAddTest.php
+++ b/tests/Api/PostsAddTest.php
@@ -420,6 +420,42 @@ TXT;
$this->assertEquals(1, $data['total']);
$this->assertEquals($title2, $data['bookmarks'][0]['bTitle']);
}
+
+ 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.testdefaultprivacyposts_add1.com');
+ $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']);
+ }
+
+ 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.testdefaultprivacyposts_add1.com');
+ $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']);
+ }
}
if (PHPUnit_MAIN_METHOD == 'Api_PostsAddTest::main') {