aboutsummaryrefslogtreecommitdiff
path: root/tests/TestBaseApi.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestBaseApi.php')
-rw-r--r--tests/TestBaseApi.php15
1 files changed, 3 insertions, 12 deletions
diff --git a/tests/TestBaseApi.php b/tests/TestBaseApi.php
index f860d10..1052ae7 100644
--- a/tests/TestBaseApi.php
+++ b/tests/TestBaseApi.php
@@ -187,8 +187,7 @@ class TestBaseApi extends TestBase
* @uses getRequest()
*/
protected function getLoggedInRequest(
- $urlSuffix = null, $auth = true, $privateKey = false,
- $setCookie = true
+ $urlSuffix = null, $auth = true, $privateKey = null
) {
if (is_array($auth)) {
list($username, $password) = $auth;
@@ -196,13 +195,7 @@ class TestBaseApi extends TestBase
$username = 'testuser';
$password = 'testpassword';
}
- //include privatekey if requested
- if ($privateKey) {
- $pKey = $this->us->getNewPrivateKey();
- } else {
- $pKey = null;
- }
- $uid = $this->addUser($username, $password, $pKey);
+ $uid = $this->addUser($username, $password, $privateKey);
$req = new HTTP_Request2(
$GLOBALS['unittestUrl'] . '/login.php?unittestMode=1',
@@ -218,9 +211,7 @@ class TestBaseApi extends TestBase
$this->assertEquals(302, $res->getStatus(), 'Login failure');
$req = $this->getRequest($urlSuffix);
- if ($setCookie) {
- $req->setCookieJar($cookies);
- }
+ $req->setCookieJar($cookies);
return array($req, $uid);
}