summaryrefslogtreecommitdiff
path: root/tests/www/rssTest.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-06-27 19:52:02 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-06-27 19:52:02 +0200
commitf2ac531f2646c34c107b92cd9ff1e2c1a12c9b39 (patch)
tree6200f5098453db50013439b9b080e3587063f89d /tests/www/rssTest.php
parent6ec3b102aa896df8ddcf6323e0635dc42ac25f98 (diff)
downloadsemanticscuttle-f2ac531f2646c34c107b92cd9ff1e2c1a12c9b39.tar.gz
semanticscuttle-f2ac531f2646c34c107b92cd9ff1e2c1a12c9b39.tar.bz2
test that using the private key does not leave unwanted login cookies
Diffstat (limited to 'tests/www/rssTest.php')
-rw-r--r--tests/www/rssTest.php41
1 files changed, 38 insertions, 3 deletions
diff --git a/tests/www/rssTest.php b/tests/www/rssTest.php
index fc49264..d6891d6 100644
--- a/tests/www/rssTest.php
+++ b/tests/www/rssTest.php
@@ -24,14 +24,15 @@ class www_rssTest extends TestBaseApi
$items = $rss->channel->item;
$this->assertEquals(0, count($items), 'I see a private bookmark');
- }//end testNoRSSPrivateKeyEnabled
+ }
+
/**
* Test a user who has RSS private key setup
* with private bookmark.
*/
- public function testRSSPrivateKeyEnabled()
+ public function testPrivateWithPrivateKey()
{
list($uId, $username, $password, $privateKey) = $this->addUserData(
null, null, true
@@ -49,9 +50,43 @@ class www_rssTest extends TestBaseApi
$this->assertEquals(1, count($items), 'I miss the private bookmark');
$this->assertEquals('private bookmark', (string)$items[0]->title);
- }//end testRSSPrivateKeyEnabled
+ }
+
+
+
+ /**
+ * Verify that fetching the feed with a private key
+ * does not keep you logged in
+ */
+ public function testPrivatekeyDoesNotKeepLoggedYouIn()
+ {
+ list($uId, $username, $password, $privateKey) = $this->addUserData(
+ null, null, true
+ );
+ $this->addBookmark(
+ $uId, null, SemanticScuttle_Model_Bookmark::SPRIVATE,
+ null, 'private bookmark'
+ );
+ $req = $this->getRequest('/' . $username . '?privatekey=' . $privateKey);
+ $cookies = $req->setCookieJar()->getCookieJar();
+ $response_body = $req->send()->getBody();
+
+ $rss = simplexml_load_string($response_body);
+ $items = $rss->channel->item;
+
+ $this->assertEquals(1, count($items), 'I miss the private bookmark');
+ $this->assertEquals('private bookmark', (string)$items[0]->title);
+
+ //request the feed again, with the same cookies
+ $req = $this->getRequest('/' . $username);
+ $req->setCookieJar($cookies);
+ $response_body = $req->send()->getBody();
+ $rss = simplexml_load_string($response_body);
+ $items = $rss->channel->item;
+ $this->assertEquals(0, count($items), 'I still see the private bookmark');
+ }
}//end class www_rssTest
?>