summaryrefslogtreecommitdiff
path: root/tests/www/bookmarksTest.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-08-17 18:20:52 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-09-05 18:50:49 +0200
commit34600fe502c625217776c909903035d9ab937dea (patch)
tree4c7db8e6733da0cb665239e467ae0180a84a139d /tests/www/bookmarksTest.php
parent160ce01f7b709c38e9c3c081076a2d3e561ae2c5 (diff)
downloadsemanticscuttle-34600fe502c625217776c909903035d9ab937dea.tar.gz
semanticscuttle-34600fe502c625217776c909903035d9ab937dea.tar.bz2
Fix bug: URLs were escaped too often in bookmark list
Diffstat (limited to 'tests/www/bookmarksTest.php')
-rwxr-xr-xtests/www/bookmarksTest.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/www/bookmarksTest.php b/tests/www/bookmarksTest.php
index ae82118..ac549d8 100755
--- a/tests/www/bookmarksTest.php
+++ b/tests/www/bookmarksTest.php
@@ -124,5 +124,33 @@ class www_bookmarksTest extends TestBaseApi
$this->assertNotContains('privateKey=', (string)$elements[0]['href']);
}//end testVerifyPrivateRSSLinkDoesNotExist
+
+
+ /**
+ * We once had the bug that URLs with special characters were escaped too
+ * often. & -> &amp;
+ */
+ public function testAddressEncoding()
+ {
+ $this->addBookmark(null, 'http://example.org?foo&bar=baz');
+
+ //get rid of bookmarks.php
+ $this->url = $GLOBALS['unittestUrl'];
+
+ $html = $this->getRequest()->send()->getBody();
+ $x = simplexml_load_string($html);
+ $ns = $x->getDocNamespaces();
+ $x->registerXPathNamespace('ns', reset($ns));
+
+ $elements = $x->xpath('//ns:a[@class="taggedlink"]');
+ $this->assertEquals(
+ 1, count($elements), 'Number of links is not 1'
+ );
+ $this->assertEquals(
+ 'http://example.org?foo&bar=baz',
+ (string)$elements[0]['href']
+ );
+ }
+
}//end class www_bookmarksTest
?>