summaryrefslogtreecommitdiff
path: root/tests/Api
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-18 22:37:42 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-18 22:37:42 +0200
commit6f04c888bf400d91437ce33b2718dc8529773337 (patch)
treec1f90df4ffd30fc8dd9bf81b51414c95307e2269 /tests/Api
parent5d5ca9efdd31fee53c52c601bdf7511bd67ff655 (diff)
downloadsemanticscuttle-6f04c888bf400d91437ce33b2718dc8529773337.tar.gz
semanticscuttle-6f04c888bf400d91437ce33b2718dc8529773337.tar.bz2
make importnetscape-test easier
Diffstat (limited to 'tests/Api')
-rw-r--r--tests/Api/PostsAddTest.php13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/Api/PostsAddTest.php b/tests/Api/PostsAddTest.php
index 3f21add..4b0bb0a 100644
--- a/tests/Api/PostsAddTest.php
+++ b/tests/Api/PostsAddTest.php
@@ -514,18 +514,13 @@ TXT;
$this->setUnittestConfig(
array('defaults' => array('privacy' => 1))
);
- list($req, $uId) = $this->getAuthRequest('?unittestMode=1');
+ list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1');
$req->setMethod(HTTP_Request2::METHOD_POST);
$req->setUrl($GLOBALS['unittestUrl'] . 'importNetscape.php' . '?unittestMode=1');
- $testcookiekey = md5($GLOBALS['dbname'].$GLOBALS['tableprefix']).'-login';
- $userinfo = $this->us->getUser($uId);
- $testcookiepassword = $userinfo['password'];
- $testusername = $userinfo['username'];
- $testcookievalue = $uId . ':' . md5($testusername . $testcookiepassword);
- $req->setCookieJar(true);
- $req->addCookie($testcookiekey, $testcookievalue);
$req->addUpload('userfile', dirname(__FILE__) . '/../data/BookmarkTest_netscapebookmarks.html');
- $req->send();
+ $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']));