Resolve some failed bookmark and tag tests

This commit is contained in:
Mark Pemberton 2011-05-21 14:36:29 -04:00
parent 5203848b12
commit e0149e24e2
5 changed files with 10 additions and 9 deletions

View File

@ -220,8 +220,8 @@ if ($currenttag!= '') {
$size = count($rsschannels); $size = count($rsschannels);
for ($i = 0; $i < $size; $i++) { for ($i = 0; $i < $size; $i++) {
$brss = '<a style="background:#FFFFFF" href="'. htmlspecialchars($rsschannels[$i][1]) . '"' $brss = '<a style="background:#FFFFFF" href="'. htmlspecialchars($rsschannels[$i][1]) . '"'
. ' title="' . htmlspecialchars($rsschannels[$i][0]) . '">' . ' title="' . $rsschannels[$i][0] . '">'
. '<img src="' . ROOT . 'images/rss.gif" width="16" height="16" alt="' . htmlspecialchars($rsschannels[$i][0]) .'"/>' . '<img src="' . ROOT . 'images/rss.gif" width="16" height="16" alt="' . $rsschannels[$i][0] .'"/>'
. '</a>'; . '</a>';
} }

View File

@ -46,6 +46,7 @@ class AllTests extends PHPUnit_Framework_TestSuite
$suite->addTestFile($tdir . '/VoteTest.php'); $suite->addTestFile($tdir . '/VoteTest.php');
$suite->addTestFile($tdir . '/UserTest.php'); $suite->addTestFile($tdir . '/UserTest.php');
$suite->addTestFile($tdir . '/Api/ExportCsvTest.php'); $suite->addTestFile($tdir . '/Api/ExportCsvTest.php');
$suite->addTestFile($tdir . '/Api/OpenSearchTest.php');
$suite->addTestFile($tdir . '/Api/PostsAddTest.php'); $suite->addTestFile($tdir . '/Api/PostsAddTest.php');
$suite->addTestFile($tdir . '/Api/PostsDeleteTest.php'); $suite->addTestFile($tdir . '/Api/PostsDeleteTest.php');
$suite->addTestFile($tdir . '/Api/PostsUpdateTest.php'); $suite->addTestFile($tdir . '/Api/PostsUpdateTest.php');
@ -58,4 +59,4 @@ class AllTests extends PHPUnit_Framework_TestSuite
{ {
} }
} }
?> ?>

View File

@ -108,7 +108,7 @@ TXT;
$this->assertEquals($bmUrl, $bm['bAddress']); $this->assertEquals($bmUrl, $bm['bAddress']);
$this->assertEquals($bmTitle, $bm['bTitle']); $this->assertEquals($bmTitle, $bm['bTitle']);
$this->assertEquals($bmDescription, $bm['bDescription']); $this->assertEquals($bmDescription, stripslashes($bm['bDescription']));
$this->assertEquals($bmTags, $bm['tags']); $this->assertEquals($bmTags, $bm['tags']);
$this->assertEquals( $this->assertEquals(
gmdate('Y-m-d H:i:s', strtotime($bmDatetime)), gmdate('Y-m-d H:i:s', strtotime($bmDatetime)),
@ -170,7 +170,7 @@ TXT;
$this->assertEquals($bmUrl, $bm['bAddress']); $this->assertEquals($bmUrl, $bm['bAddress']);
$this->assertEquals($bmTitle, $bm['bTitle']); $this->assertEquals($bmTitle, $bm['bTitle']);
$this->assertEquals($bmDescription, $bm['bDescription']); $this->assertEquals($bmDescription, stripslashes($bm['bDescription']));
$this->assertEquals($bmTags, $bm['tags']); $this->assertEquals($bmTags, $bm['tags']);
$this->assertEquals( $this->assertEquals(
gmdate('Y-m-d H:i:s', strtotime($bmDatetime)), gmdate('Y-m-d H:i:s', strtotime($bmDatetime)),

View File

@ -290,8 +290,8 @@ class Bookmark2TagTest extends TestBase
$arTags = $this->b2ts->getPopularTags(null, 10, null, 1); $arTags = $this->b2ts->getPopularTags(null, 10, null, 1);
$this->assertInternalType('array', $arTags); $this->assertInternalType('array', $arTags);
$this->assertEquals(3, count($arTags)); $this->assertEquals(3, count($arTags));
$this->assertContains(array('tag' => 'one', 'bCount' => '2'), $arTags); $this->assertContains(array('tag' => 'one', 'bCount' => '3'), $arTags);
$this->assertContains(array('tag' => 'two', 'bCount' => '1'), $arTags); $this->assertContains(array('tag' => 'two', 'bCount' => '2'), $arTags);
$this->assertContains(array('tag' => 'thr', 'bCount' => '1'), $arTags); $this->assertContains(array('tag' => 'thr', 'bCount' => '1'), $arTags);
$arTags = $this->b2ts->getPopularTags(null, 10, null, 2); $arTags = $this->b2ts->getPopularTags(null, 10, null, 2);
@ -608,4 +608,4 @@ class Bookmark2TagTest extends TestBase
$this->assertContains(array('tag' => 'usable', 'bCount' => '2'), $arTags); $this->assertContains(array('tag' => 'usable', 'bCount' => '2'), $arTags);
} }
} }
?> ?>

View File

@ -42,7 +42,7 @@ if (GET_ACTION == "logout") {
// Header variables // Header variables
$tplVars['loadjs'] = true; $tplVars['loadjs'] = true;
$tplVars['rsschannels'] = array( $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()) { if ($userservice->isLoggedOn()) {