aboutsummaryrefslogtreecommitdiff
path: root/tests/TestBaseApi.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-06-27 19:39:38 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-06-27 19:39:38 +0200
commit6ec3b102aa896df8ddcf6323e0635dc42ac25f98 (patch)
tree5215bb0cc69d68b69767292afc7838217d48b8b5 /tests/TestBaseApi.php
parentd2aecd8a76a8c1f0d326cae13f158b74b6e60709 (diff)
downloadsemanticscuttle-6ec3b102aa896df8ddcf6323e0635dc42ac25f98.tar.gz
semanticscuttle-6ec3b102aa896df8ddcf6323e0635dc42ac25f98.tar.bz2
make the private tests really test something
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);
}