aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-26 07:00:33 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-26 07:00:33 +0200
commit3e5cadc7648658e2c92fbb580d622997f5dc874e (patch)
tree3c0cc05fbb0cb2a338ef9037aba7c4feeefd7380
parent43b6021be794ff20af9b423ecfacf382916c80b1 (diff)
downloadsemanticscuttle-3e5cadc7648658e2c92fbb580d622997f5dc874e.tar.gz
semanticscuttle-3e5cadc7648658e2c92fbb580d622997f5dc874e.tar.bz2
use cookie jar instead of manually creating the cookie
-rw-r--r--tests/Api/PostsAddTest.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/tests/Api/PostsAddTest.php b/tests/Api/PostsAddTest.php
index bc8f13e..b915b4c 100644
--- a/tests/Api/PostsAddTest.php
+++ b/tests/Api/PostsAddTest.php
@@ -564,6 +564,7 @@ TXT;
array('defaults' => array('privacy' => 2))
);
list($req, $uId) = $this->getLoggedInRequest();
+ $cookies = $req->getCookieJar();
$req->setMethod(HTTP_Request2::METHOD_POST);
$req->addPostParameter('url', 'http://www.example.org/testdefaultprivacyposts_bookmarksget');
$req->addPostParameter('description', 'Test bookmark 1 for default privacy.');
@@ -582,13 +583,7 @@ TXT;
list($req, $uId) = $this->getAuthRequest('?unittestMode=1');
$req->setMethod(HTTP_Request2::METHOD_POST);
$req->setUrl($reqUrl);
- $testcookiekey = md5($GLOBALS['dbname'].$GLOBALS['tableprefix']).'-login';
- $userinfo = $this->us->getUser($oldUid);
- $testcookiepassword = $userinfo['password'];
- $testusername = $userinfo['username'];
- $testcookievalue = $oldUid . ':' . md5($testusername . $testcookiepassword);
- $req->setCookieJar(true);
- $req->addCookie($testcookiekey, $testcookievalue);
+ $req->setCookieJar($cookies);
$req->addPostParameter('submitted', '1');
$response = $req->send();
$response_body = $response->getBody();