aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-08-17 18:20:52 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-08-17 18:20:52 +0200
commit196db46097a8e7bdce478c5c8559d3ecf0529114 (patch)
tree69076de98c0748d633caff694e04e2eb3529b06f /tests
parenta468938a5a87c6cd135afbc3bf122723c9305d4f (diff)
downloadsemanticscuttle-196db46097a8e7bdce478c5c8559d3ecf0529114.tar.gz
semanticscuttle-196db46097a8e7bdce478c5c8559d3ecf0529114.tar.bz2
Fix bug: URLs were escaped too often in bookmark list
Diffstat (limited to 'tests')
-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
?>