From fc093a5fe51d35a2991e549e8836cac15dc2888b Mon Sep 17 00:00:00 2001 From: bretticvs Date: Thu, 5 May 2011 16:24:21 -0600 Subject: Moved testDefaultPrivacyEdit() to tests/www/editTest.php. Moved testDefaultPrivacyImportNetscape() to tests/www/importNetscapeTest.php. Moved testDefaultPrivacyImport() to tests/www/importTest.php. Moved testDefaultPrivacyBookmarksAddMissingTitleMissingPrivacy() to tests/www/bookmarksTest.php. Moved testDefaultPrivacyBookmarksAdd() to tests/www/bookmarksTest.php. Kept testDefaultPrivacyPrivate() in tests/api/PostsAddTest.php. Kept testDefaultPrivacyPublic() in tests/api/PostsAddTest.php. --- tests/www/editTest.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 tests/www/editTest.php (limited to 'tests/www/editTest.php') diff --git a/tests/www/editTest.php b/tests/www/editTest.php new file mode 100755 index 0000000..1e0fbd5 --- /dev/null +++ b/tests/www/editTest.php @@ -0,0 +1,48 @@ +setUnittestConfig( + array('defaults' => array('privacy' => 2)) + ); + + list($req, $uId) = $this->getLoggedInRequest('?unittestMode=1'); + $cookies = $req->getCookieJar(); + $req->setMethod(HTTP_Request2::METHOD_POST); + $req->addPostParameter('url', 'http://www.example.org/testdefaultprivacyposts_edit'); + $req->addPostParameter('description', 'Test bookmark 2 for default privacy.'); + $req->addPostParameter('status', '0'); + $res = $req->send(); + $this->assertEquals( + 200, $res->getStatus(), + 'Adding bookmark failed: ' . $res->getBody()); + $bms = $this->bs->getBookmarks(0, null, $uId); + $bm = reset($bms['bookmarks']); + $bmId = $bm['bId']; + + $reqUrl = $GLOBALS['unittestUrl'] . 'edit.php/' . $bmId . '?unittestMode=1'; + $req2 = new HTTP_Request2($reqUrl, HTTP_Request2::METHOD_POST); + $req2->setCookieJar($cookies); + $req2->addPostParameter('address', 'http://www.example.org/testdefaultprivacyposts_edit'); + $req2->addPostParameter('title', 'Test bookmark 2 for default privacy.'); + $req2->addPostParameter('submitted', '1'); + $res = $req2->send(); + + $this->assertEquals(302, $res->getStatus(), 'Editing bookmark failed'); + + $bm = $this->bs->getBookmark($bmId); + $this->assertEquals('2', $bm['bStatus']); + }//end testDefaultPrivacyEdit + +}//end class www_editTest +?> -- cgit v1.2.3