summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-05-20 07:02:52 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-05-20 07:02:52 +0200
commit191f08683edb9970c2ad6c061840292c2df14d61 (patch)
treec72f96d5f302228f3ce73c5276e05e5a4fb2958b /tests
parent675aa6291a39c0bc77636cca3453b7874e97b6c3 (diff)
downloadsemanticscuttle-191f08683edb9970c2ad6c061840292c2df14d61.tar.gz
semanticscuttle-191f08683edb9970c2ad6c061840292c2df14d61.tar.bz2
all but one test work now with a different unittest database
Diffstat (limited to 'tests')
-rw-r--r--tests/TestBaseApi.php25
1 files changed, 19 insertions, 6 deletions
diff --git a/tests/TestBaseApi.php b/tests/TestBaseApi.php
index 1f2e8ff..20574f3 100644
--- a/tests/TestBaseApi.php
+++ b/tests/TestBaseApi.php
@@ -72,10 +72,26 @@ class TestBaseApi extends TestBase
* @param string $urlSuffix Suffix for the URL
*
* @return HTTP_Request2 HTTP request object
+ */
+ protected function getRequest($urlSuffix = null)
+ {
+ $url = $this->getTestUrl($urlSuffix);
+ $req = new HTTP_Request2($url, HTTP_Request2::METHOD_GET);
+
+ return $req;
+ }
+
+ /**
+ * Creates an URL from $this->url plus $urlSuffix and an appended
+ * unittestMode=1 parameter.
+ *
+ * @param string $urlSuffix Suffix for the URL
+ *
+ * @return string URL
*
* @uses $url
*/
- protected function getRequest($urlSuffix = null)
+ protected function getTestUrl($urlSuffix = null)
{
$url = $this->url . $urlSuffix;
if (strpos($urlSuffix, '?') !== false) {
@@ -83,10 +99,7 @@ class TestBaseApi extends TestBase
} else {
$url .= '?unittestMode=1';
}
-
- $req = new HTTP_Request2($url, HTTP_Request2::METHOD_GET);
-
- return $req;
+ return $url;
}
@@ -170,7 +183,7 @@ class TestBaseApi extends TestBase
$uid = $this->addUser($username, $password);
$req = new HTTP_Request2(
- $GLOBALS['unittestUrl'] . '/login.php',
+ $GLOBALS['unittestUrl'] . '/login.php?unittestMode=1',
HTTP_Request2::METHOD_POST
);
$cookies = $req->setCookieJar()->getCookieJar();