summaryrefslogtreecommitdiff
path: root/tests/Api
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-18 22:39:06 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-18 22:39:06 +0200
commit79e3f4e121146254a8e17c3bd271679c815eca8c (patch)
tree56698cd37a01efca02f23bc2f48445374a76b724 /tests/Api
parent6f04c888bf400d91437ce33b2718dc8529773337 (diff)
downloadsemanticscuttle-79e3f4e121146254a8e17c3bd271679c815eca8c.tar.gz
semanticscuttle-79e3f4e121146254a8e17c3bd271679c815eca8c.tar.bz2
make import test easier
Diffstat (limited to 'tests/Api')
-rw-r--r--tests/Api/PostsAddTest.php15
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/Api/PostsAddTest.php b/tests/Api/PostsAddTest.php
index 4b0bb0a..1bd6174 100644
--- a/tests/Api/PostsAddTest.php
+++ b/tests/Api/PostsAddTest.php
@@ -514,7 +514,7 @@ TXT;
$this->setUnittestConfig(
array('defaults' => array('privacy' => 1))
);
- list($req, $uId) = $this->getLoggedInRequest('?unittestMode=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');
@@ -538,18 +538,13 @@ TXT;
$this->setUnittestConfig(
array('defaults' => array('privacy' => 2))
);
- list($req, $uId) = $this->getAuthRequest('?unittestMode=1');
+ list($req, $uId) = $this->getLoggedInRequest();
$req->setMethod(HTTP_Request2::METHOD_POST);
$req->setUrl($GLOBALS['unittestUrl'] . 'import.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_deliciousbookmarks.xml');
- $req->send();
+ $res = $req->send();
+ $this->assertEquals(302, $res->getStatus(), 'Bookmark import failed');
+
$this->us->setCurrentUserId($uId);
$bms = $this->bs->getBookmarks(0, null, $uId);
$this->assertEquals(3, count($bms['bookmarks']));