fix tests for people that use a separate test database

This commit is contained in:
Christian Weiske 2011-06-08 07:00:17 +02:00
parent 1dc33f4416
commit 44a65eddac
2 changed files with 6 additions and 11 deletions

View file

@ -87,7 +87,7 @@ class www_bookmarksTest extends TestBaseApi
$user = $this->us->getUser($uId); $user = $this->us->getUser($uId);
$reqUrl = $GLOBALS['unittestUrl'] . 'bookmarks.php/' $reqUrl = $GLOBALS['unittestUrl'] . 'bookmarks.php/'
. $user['username']; . $user['username'] . '?unittestMode=1';
$req->setUrl($reqUrl); $req->setUrl($reqUrl);
$req->setMethod(HTTP_Request2::METHOD_GET); $req->setMethod(HTTP_Request2::METHOD_GET);
$response = $req->send(); $response = $req->send();
@ -114,7 +114,7 @@ class www_bookmarksTest extends TestBaseApi
$user = $this->us->getUser($uId); $user = $this->us->getUser($uId);
$reqUrl = $GLOBALS['unittestUrl'] . 'bookmarks.php/' $reqUrl = $GLOBALS['unittestUrl'] . 'bookmarks.php/'
. $user['username']; . $user['username'] . '?unittestMode=1';
$req->setUrl($reqUrl); $req->setUrl($reqUrl);
$req->setMethod(HTTP_Request2::METHOD_GET); $req->setMethod(HTTP_Request2::METHOD_GET);
$response = $req->send(); $response = $req->send();

View file

@ -4,7 +4,7 @@ require_once 'HTTP/Request2.php';
class www_indexTest extends TestBaseApi class www_indexTest extends TestBaseApi
{ {
protected $urlPart = 'api/posts/add'; protected $urlPart = '';
/** /**
* Test that the private rss feed exists when user is setup * Test that the private rss feed exists when user is setup
@ -15,11 +15,9 @@ class www_indexTest extends TestBaseApi
list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1', true, true); list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1', true, true);
$user = $this->us->getUser($uId); $user = $this->us->getUser($uId);
$reqUrl = $GLOBALS['unittestUrl'] . 'index.php/';
$req->setUrl($reqUrl);
$req->setMethod(HTTP_Request2::METHOD_GET);
$response = $req->send(); $response = $req->send();
$response_body = $response->getBody(); $response_body = $response->getBody();
$this->assertNotEquals('', $response_body, 'Response is empty'); $this->assertNotEquals('', $response_body, 'Response is empty');
$x = simplexml_load_string($response_body); $x = simplexml_load_string($response_body);
@ -32,19 +30,16 @@ class www_indexTest extends TestBaseApi
}//end testVerifyPrivateRSSLinkExists }//end testVerifyPrivateRSSLinkExists
/** /**
* Test that the private RSS link doesn't exists when a user * Test that the private RSS link doesn't exists when a user
* does not have a private key or is not enabled * does not have a private key, or the private key is not enabled
*/ */
public function testVerifyPrivateRSSLinkDoesNotExist() public function testVerifyPrivateRSSLinkDoesNotExist()
{ {
list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1', true); list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1', true);
$user = $this->us->getUser($uId); $user = $this->us->getUser($uId);
$reqUrl = $GLOBALS['unittestUrl'] . 'bookmarks.php/'
. $user['username'];
$req->setUrl($reqUrl);
$req->setMethod(HTTP_Request2::METHOD_GET);
$response = $req->send(); $response = $req->send();
$response_body = $response->getBody(); $response_body = $response->getBody();
$this->assertNotEquals('', $response_body, 'Response is empty'); $this->assertNotEquals('', $response_body, 'Response is empty');