]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
make importnetscape-test easier
authorChristian Weiske <cweiske@cweiske.de>
Mon, 18 Apr 2011 20:37:42 +0000 (22:37 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 18 Apr 2011 20:37:42 +0000 (22:37 +0200)
tests/Api/PostsAddTest.php

index 3f21add1cab4e152034c9153f1575abf31ecb260..4b0bb0a22d8ef96f3397f4b8964a877a3c7f0ec6 100644 (file)
@@ -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']));