all but one test work now with a different unittest database

This commit is contained in:
Christian Weiske 2011-05-20 07:02:52 +02:00
parent 675aa6291a
commit 191f08683e

View file

@ -72,10 +72,26 @@ class TestBaseApi extends TestBase
* @param string $urlSuffix Suffix for the URL * @param string $urlSuffix Suffix for the URL
* *
* @return HTTP_Request2 HTTP request object * @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 * @uses $url
*/ */
protected function getRequest($urlSuffix = null) protected function getTestUrl($urlSuffix = null)
{ {
$url = $this->url . $urlSuffix; $url = $this->url . $urlSuffix;
if (strpos($urlSuffix, '?') !== false) { if (strpos($urlSuffix, '?') !== false) {
@ -83,10 +99,7 @@ class TestBaseApi extends TestBase
} else { } else {
$url .= '?unittestMode=1'; $url .= '?unittestMode=1';
} }
return $url;
$req = new HTTP_Request2($url, HTTP_Request2::METHOD_GET);
return $req;
} }
@ -170,7 +183,7 @@ class TestBaseApi extends TestBase
$uid = $this->addUser($username, $password); $uid = $this->addUser($username, $password);
$req = new HTTP_Request2( $req = new HTTP_Request2(
$GLOBALS['unittestUrl'] . '/login.php', $GLOBALS['unittestUrl'] . '/login.php?unittestMode=1',
HTTP_Request2::METHOD_POST HTTP_Request2::METHOD_POST
); );
$cookies = $req->setCookieJar()->getCookieJar(); $cookies = $req->setCookieJar()->getCookieJar();