From 65bd4bfab86fc47be3ce125640ebd49163f24f4b Mon Sep 17 00:00:00 2001 From: bretticvs Date: Tue, 15 Mar 2011 07:53:39 +0100 Subject: Updates for feature request 3164348: Make default privacy configurable. --- tests/BookmarkTest.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tests') diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index f54fe9a..aa0b8c3 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -1343,6 +1343,30 @@ class BookmarkTest extends TestBase } + /** + * Test that the default privacy setting in + * $GLOBALS['defaults']['privacy'] is used + * as expected. + * + * @return void + */ + public function testDefaultPrivacy() + { + $GLOBALS['defaults']['privacy'] = 1; + $uid = $this->addUser(); + $this->us->setCurrentUserId($uid); + $bid = $this->bs->addBookmark('http://www.somedomain.com', 'mybookmark1', 'descr1', 'privatenote1', $GLOBALS['defaults']['privacy'], array()); + $bm = $this->bs->getBookmark($bid); + $this->assertEquals('1', $bm['bStatus']); + $GLOBALS['defaults']['privacy'] = 2; + $uid = $this->addUser(); + $this->us->setCurrentUserId($uid); + $bid = $this->bs->addBookmark('http://www.anotherdomain.com', 'mybookmark2', 'descr2', 'privatenote2', $GLOBALS['defaults']['privacy'], array()); + $bm = $this->bs->getBookmark($bid); + $this->assertEquals('2', $bm['bStatus']); + }//end function testDefaultPrivacy + + } -- cgit v1.2.3