From fb11021ed7eadf7443755e936cbad34fbfec7d4c Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 3 May 2011 19:10:12 +0200 Subject: do not add bookmarks with an invalid URL --- tests/BookmarkTest.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/BookmarkTest.php') diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index e7ce488..7533f3a 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -65,7 +65,16 @@ class BookmarkTest extends TestBase $this->assertEquals('myShortName', $bm['bShort']); } - public function testHardCharactersInBookmarks() + public function testAddBookmarkInvalidUrl() + { + $retval = $this->bs->addBookmark( + 'javascript:alert(123)', 'title', 'desc', 'priv', + 0, array() + ); + $this->assertFalse($retval, 'Bookmark with invalid URL was accepted'); + } + + public function testAddBookmarkWithSpecialCharacters() { $bs = $this->bs; $title = "title&é\"'(-è_çà)="; -- cgit v1.2.3 From 4a3fdcc4dd5e1298ec701817ae7041e9992a8ff8 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Tue, 3 May 2011 19:10:30 +0200 Subject: rename test method --- tests/BookmarkTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tests/BookmarkTest.php') diff --git a/tests/BookmarkTest.php b/tests/BookmarkTest.php index 7533f3a..b50dab2 100644 --- a/tests/BookmarkTest.php +++ b/tests/BookmarkTest.php @@ -50,8 +50,6 @@ class BookmarkTest extends TestBase /** * Tests if adding a bookmark with short url name * saves it in the database. - * - * @return void */ public function testAddBookmarkShort() { @@ -104,7 +102,7 @@ class BookmarkTest extends TestBase ); } - public function testUnificationOfBookmarks() + public function testAddBookmarkUnification() { $bs = $this->bs; -- cgit v1.2.3