aboutsummaryrefslogtreecommitdiff
path: root/tests/www/importNetscapeTest.php
diff options
context:
space:
mode:
authorbretticvs <bsdee@frii.com>2011-05-05 16:24:21 -0600
committerbretticvs <bsdee@frii.com>2011-05-05 16:24:21 -0600
commitfc093a5fe51d35a2991e549e8836cac15dc2888b (patch)
tree3606d2acbcbf1d204ace13d8d610830eb1a8878d /tests/www/importNetscapeTest.php
parent8be81abfe6193e221afcdc35582d34505797a7b8 (diff)
downloadsemanticscuttle-fc093a5fe51d35a2991e549e8836cac15dc2888b.tar.gz
semanticscuttle-fc093a5fe51d35a2991e549e8836cac15dc2888b.tar.bz2
Moved testDefaultPrivacyEdit() to tests/www/editTest.php.
Moved testDefaultPrivacyImportNetscape() to tests/www/importNetscapeTest.php. Moved testDefaultPrivacyImport() to tests/www/importTest.php. Moved testDefaultPrivacyBookmarksAddMissingTitleMissingPrivacy() to tests/www/bookmarksTest.php. Moved testDefaultPrivacyBookmarksAdd() to tests/www/bookmarksTest.php. Kept testDefaultPrivacyPrivate() in tests/api/PostsAddTest.php. Kept testDefaultPrivacyPublic() in tests/api/PostsAddTest.php.
Diffstat (limited to 'tests/www/importNetscapeTest.php')
-rwxr-xr-xtests/www/importNetscapeTest.php33
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
+?>