diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-06-27 22:27:17 +0200 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-06-27 22:27:17 +0200 |
commit | 763d394436dc632bf18bff8876af22be9b44e9f4 (patch) | |
tree | e31987b7806c7d3b13f851d6620cc9c22c3992a7 /tests | |
parent | 673fdc87582c2087beed8d33505213cbd83755cb (diff) | |
download | semanticscuttle-763d394436dc632bf18bff8876af22be9b44e9f4.tar.gz semanticscuttle-763d394436dc632bf18bff8876af22be9b44e9f4.tar.bz2 |
test global feed with private bookmarks
Diffstat (limited to 'tests')
-rw-r--r-- | tests/www/rssTest.php | 52 |
1 files changed, 49 insertions, 3 deletions
diff --git a/tests/www/rssTest.php b/tests/www/rssTest.php index 4fab479..75e4363 100644 --- a/tests/www/rssTest.php +++ b/tests/www/rssTest.php @@ -23,8 +23,29 @@ class www_rssTest extends TestBaseApi + /** - * A private bookmark should not show up in an rss feed if the + * A private bookmark should not show up in the global rss feed if the + * user is not logged in nor passes the private key + */ + public function testAllPrivateBookmarkNotLoggedIn() + { + list($uId, $username) = $this->addUserData(); + $this->addBookmark( + $uId, null, SemanticScuttle_Model_Bookmark::SPRIVATE + ); + + $req = $this->getRequest(); + $response_body = $req->send()->getBody(); + + $rss = simplexml_load_string($response_body); + $this->assertItemCount($rss, 0, 'I see a private bookmark'); + } + + + + /** + * A private bookmark should not show up in the user's rss feed if the * user is not logged in nor passes the private key */ public function testUserPrivateBookmarkNotLoggedIn() @@ -43,9 +64,34 @@ class www_rssTest extends TestBaseApi + + /** + * Test the global feed by passing the private key + */ + public function testAllPrivateBookmarkWithPrivateKey() + { + list($uId, $username, $password, $privateKey) = $this->addUserData( + null, null, true + ); + $this->addBookmark( + $uId, null, SemanticScuttle_Model_Bookmark::SPRIVATE, + null, 'private bookmark' + ); + + $req = $this->getRequest('?privatekey=' . $privateKey); + $response_body = $req->send()->getBody(); + + $rss = simplexml_load_string($response_body); + $this->assertItemCount($rss, 1, 'I miss the private bookmark'); + $this->assertEquals( + 'private bookmark', (string)$rss->channel->item[0]->title + ); + } + + + /** - * Test a user who has RSS private key setup - * with private bookmark. + * Test the user feed by passing the private key */ public function testUserPrivateBookmarkWithPrivateKey() { |