diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-05-13 06:57:54 +0200 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-05-13 06:57:54 +0200 |
commit | 803b83fb7d051593066b5224a59fbf3ec6efc824 (patch) | |
tree | 173c97393f9e211b05f8c73793c180a1b88799b0 /tests/www/importNetscapeTest.php | |
parent | fbfbd8d5cae579058b5d31b97c062cefd9bb36b6 (diff) | |
parent | 88d7b9631b444cef28115fb8e0bae736b45e557e (diff) | |
download | semanticscuttle-803b83fb7d051593066b5224a59fbf3ec6efc824.tar.gz semanticscuttle-803b83fb7d051593066b5224a59fbf3ec6efc824.tar.bz2 |
Merge branch 'master' into ssl-client-certs
Diffstat (limited to 'tests/www/importNetscapeTest.php')
-rwxr-xr-x | tests/www/importNetscapeTest.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/www/importNetscapeTest.php b/tests/www/importNetscapeTest.php new file mode 100755 index 0000000..9d4cacd --- /dev/null +++ b/tests/www/importNetscapeTest.php @@ -0,0 +1,33 @@ +<?php +require_once dirname(__FILE__) . '/../prepare.php'; +require_once 'HTTP/Request2.php'; + +class www_importNetscapeTest extends TestBaseApi +{ + protected $urlPart = 'importNetscape.php'; + + /** + * Test that the default privacy setting is used when bookmarks + * are imported from an HTML bookmarks file using importNetscape.php. + */ + public function testDefaultPrivacyImportNetscape() + { + $this->setUnittestConfig( + array('defaults' => array('privacy' => 1)) + ); + list($req, $uId) = $this->getLoggedInRequest(); + $req->setMethod(HTTP_Request2::METHOD_POST); + $req->setUrl($GLOBALS['unittestUrl'] . 'importNetscape.php' . '?unittestMode=1'); + $req->addUpload('userfile', dirname(__FILE__) . '/../data/BookmarkTest_netscapebookmarks.html'); + $res = $req->send(); + $this->assertEquals(200, $res->getStatus(), 'Bookmark import failed'); + + $this->us->setCurrentUserId($uId); + $bms = $this->bs->getBookmarks(0, null, $uId); + $this->assertEquals(3, count($bms['bookmarks'])); + $bm = reset($bms['bookmarks']); + $this->assertEquals('1', $bm['bStatus']); + }//end testDefaultPrivacyImportNetscape + +}//end class www_importNetscapeTest +?> |