diff options
author | bretticvs <bsdee@frii.com> | 2011-04-17 17:42:49 -0600 |
---|---|---|
committer | bretticvs <bsdee@frii.com> | 2011-04-17 17:42:49 -0600 |
commit | 3b582fd875de425d91bc143a33dc07e554246a80 (patch) | |
tree | 52e0c7be451e5ec5022878e84b109183a576dd73 /tests/BookmarkTest.php | |
parent | 200cb1d3c54dfaae54d26c0d51f6086435bcee8e (diff) | |
download | semanticscuttle-3b582fd875de425d91bc143a33dc07e554246a80.tar.gz semanticscuttle-3b582fd875de425d91bc143a33dc07e554246a80.tar.bz2 |
Moved unit tests to PostsAddTest.php in Api directory.
Diffstat (limited to 'tests/BookmarkTest.php')
-rw-r--r-- | tests/BookmarkTest.php | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index ad1cb48..f54fe9a 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -1343,92 +1343,6 @@ class BookmarkTest extends TestBase } - /** - * Test that the default privacy setting in - * $GLOBALS['defaults']['privacy'] is used - * as expected. - * - * @return void - */ - public function testDefaultPrivacy() - { - //For this test, the default privacy has been set to 2 (private) in the configuration file. - require_once 'HTTP/Request2.php'; - require_once dirname(__FILE__) . '/../data/config.php'; - $this->bs->deleteAll(); - $this->us->deleteAll(); - - $request = new HTTP_Request2('http://localhost/edit.php/2', HTTP_Request2::METHOD_POST); - $testcookiekey = md5($GLOBALS['dbname'].$GLOBALS['tableprefix']).'-login'; - $userinfo = $this->us->getUser('1'); - $testcookiepassword = $userinfo['password']; - $testcookievalue = '1:'.md5('dpuser'.$testcookiepassword); - $request->setCookieJar(true); - $request->addCookie($testcookiekey, $testcookievalue); - $request->addPostParameter('title', 'Test bookmark 2 for default privacy.'); - $request->addPostParameter('address', 'http://www.testdefaultprivacyposts_add2.com'); - $request->addPostParameter('submitted', '1'); - $request->send(); - $bm = $this->bs->getBookmark('2'); - $this->assertEquals('2', $bm['bStatus']); - - $request = new HTTP_Request2('http://localhost/importNetscape.php', HTTP_Request2::METHOD_POST); - $request->setCookieJar(true); - $request->addCookie($testcookiekey, $testcookievalue); - $request->addUpload('userfile', './data/BookmarkTest_netscapebookmarks.html'); - $request->send(); - $bm = $this->bs->getBookmark('3'); - $this->assertEquals('2', $bm['bStatus']); - $bm = $this->bs->getBookmark('4'); - $this->assertEquals('2', $bm['bStatus']); - $bm = $this->bs->getBookmark('5'); - $this->assertEquals('2', $bm['bStatus']); - - $request = new HTTP_Request2('http://localhost/import.php', HTTP_Request2::METHOD_POST); - $request->setCookieJar(true); - $request->addCookie($testcookiekey, $testcookievalue); - $request->addUpload('userfile', './data/BookmarkTest_deliciousbookmarks.xml'); - $request->send(); - $bm = $this->bs->getBookmark('6'); - $this->assertEquals('2', $bm['bStatus']); - $bm = $this->bs->getBookmark('7'); - $this->assertEquals('2', $bm['bStatus']); - $bm = $this->bs->getBookmark('8'); - $this->assertEquals('2', $bm['bStatus']); - - $request = new HTTP_Request2('http://localhost/bookmarks.php/dpuser?action=get', HTTP_Request2::METHOD_POST); - $request->setCookieJar(true); - $request->addCookie($testcookiekey, $testcookievalue); - $request->addPostParameter('submitted', '1'); - $response = $request->send(); - $response_body = $response->getBody(); - $start = strpos($response_body, 'Privacy'); - $end = strpos($response_body, 'referrer'); - $length = $end - $start; - $response_body = substr($response_body, $start, $length); - $start = strpos($response_body, 'selected'); - $start = $start - 3; - $length = 1; - $selected_privacy = substr($response_body, $start, $length); - $this->assertEquals('2', $selected_privacy); - - $request = new HTTP_Request2('http://localhost/bookmarks.php/dpuser?action=add', HTTP_Request2::METHOD_POST); - $request->setCookieJar(true); - $request->addCookie($testcookiekey, $testcookievalue); - $response = $request->send(); - $response_body = $response->getBody(); - $start = strpos($response_body, 'Privacy'); - $end = strpos($response_body, 'referrer'); - $length = $end - $start; - $response_body = substr($response_body, $start, $length); - $start = strpos($response_body, 'selected'); - $start = $start - 3; - $length = 1; - $selected_privacy = substr($response_body, $start, $length); - $this->assertEquals('2', $selected_privacy); - }//end function testDefaultPrivacy - - } |