From e0149e24e2b5fac3b875fda468b18fbe2b6b1218 Mon Sep 17 00:00:00 2001 From: Mark Pemberton Date: Sat, 21 May 2011 14:36:29 -0400 Subject: [PATCH] Resolve some failed bookmark and tag tests --- data/templates/bookmarks.tpl.php | 4 ++-- tests/AllTests.php | 3 ++- tests/Api/PostsAddTest.php | 4 ++-- tests/Bookmark2TagTest.php | 6 +++--- www/index.php | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php index 55d6a0f..42aaa95 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/bookmarks.tpl.php @@ -220,8 +220,8 @@ if ($currenttag!= '') { $size = count($rsschannels); for ($i = 0; $i < $size; $i++) { $brss = '' - . '' . htmlspecialchars($rsschannels[$i][0]) .'' + . ' title="' . $rsschannels[$i][0] . '">' + . '' . $rsschannels[$i][0] .'' . ''; } diff --git a/tests/AllTests.php b/tests/AllTests.php index 9e825e8..92f8960 100644 --- a/tests/AllTests.php +++ b/tests/AllTests.php @@ -46,6 +46,7 @@ class AllTests extends PHPUnit_Framework_TestSuite $suite->addTestFile($tdir . '/VoteTest.php'); $suite->addTestFile($tdir . '/UserTest.php'); $suite->addTestFile($tdir . '/Api/ExportCsvTest.php'); + $suite->addTestFile($tdir . '/Api/OpenSearchTest.php'); $suite->addTestFile($tdir . '/Api/PostsAddTest.php'); $suite->addTestFile($tdir . '/Api/PostsDeleteTest.php'); $suite->addTestFile($tdir . '/Api/PostsUpdateTest.php'); @@ -58,4 +59,4 @@ class AllTests extends PHPUnit_Framework_TestSuite { } } -?> \ No newline at end of file +?> diff --git a/tests/Api/PostsAddTest.php b/tests/Api/PostsAddTest.php index 02e2b38..e6d0531 100644 --- a/tests/Api/PostsAddTest.php +++ b/tests/Api/PostsAddTest.php @@ -108,7 +108,7 @@ TXT; $this->assertEquals($bmUrl, $bm['bAddress']); $this->assertEquals($bmTitle, $bm['bTitle']); - $this->assertEquals($bmDescription, $bm['bDescription']); + $this->assertEquals($bmDescription, stripslashes($bm['bDescription'])); $this->assertEquals($bmTags, $bm['tags']); $this->assertEquals( gmdate('Y-m-d H:i:s', strtotime($bmDatetime)), @@ -170,7 +170,7 @@ TXT; $this->assertEquals($bmUrl, $bm['bAddress']); $this->assertEquals($bmTitle, $bm['bTitle']); - $this->assertEquals($bmDescription, $bm['bDescription']); + $this->assertEquals($bmDescription, stripslashes($bm['bDescription'])); $this->assertEquals($bmTags, $bm['tags']); $this->assertEquals( gmdate('Y-m-d H:i:s', strtotime($bmDatetime)), diff --git a/tests/Bookmark2TagTest.php b/tests/Bookmark2TagTest.php index 789540f..66a6e1f 100644 --- a/tests/Bookmark2TagTest.php +++ b/tests/Bookmark2TagTest.php @@ -290,8 +290,8 @@ class Bookmark2TagTest extends TestBase $arTags = $this->b2ts->getPopularTags(null, 10, null, 1); $this->assertInternalType('array', $arTags); $this->assertEquals(3, count($arTags)); - $this->assertContains(array('tag' => 'one', 'bCount' => '2'), $arTags); - $this->assertContains(array('tag' => 'two', 'bCount' => '1'), $arTags); + $this->assertContains(array('tag' => 'one', 'bCount' => '3'), $arTags); + $this->assertContains(array('tag' => 'two', 'bCount' => '2'), $arTags); $this->assertContains(array('tag' => 'thr', 'bCount' => '1'), $arTags); $arTags = $this->b2ts->getPopularTags(null, 10, null, 2); @@ -608,4 +608,4 @@ class Bookmark2TagTest extends TestBase $this->assertContains(array('tag' => 'usable', 'bCount' => '2'), $arTags); } } -?> \ No newline at end of file +?> diff --git a/www/index.php b/www/index.php index 0977923..931d64d 100644 --- a/www/index.php +++ b/www/index.php @@ -42,7 +42,7 @@ if (GET_ACTION == "logout") { // Header variables $tplVars['loadjs'] = true; $tplVars['rsschannels'] = array( -array(sprintf(T_('%s: Recent bookmarks'), $sitename), createURL('rss').'?sort='.getSortOrder()) +array(sprintf(T_('%s: Recent bookmarks'), htmlspecialchars($sitename)), createURL('rss').'?sort='.getSortOrder()) ); if ($userservice->isLoggedOn()) {