aboutsummaryrefslogtreecommitdiff
path: root/tests/www/searchTest.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-15 07:55:06 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-15 07:55:06 +0200
commita25838b267f76c027318df268797842b52d6ecea (patch)
treeefb597e717c5c58518c0bbb5347cf5353e66ef02 /tests/www/searchTest.php
parent5d22905ce7eb97d60c3dafddc3e96136a2b94436 (diff)
downloadsemanticscuttle-a25838b267f76c027318df268797842b52d6ecea.tar.gz
semanticscuttle-a25838b267f76c027318df268797842b52d6ecea.tar.bz2
Fix bug #3097187: Using opensearch with two tags does not work in Firefox
Diffstat (limited to 'tests/www/searchTest.php')
-rw-r--r--tests/www/searchTest.php53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/www/searchTest.php b/tests/www/searchTest.php
new file mode 100644
index 0000000..81eb2cc
--- /dev/null
+++ b/tests/www/searchTest.php
@@ -0,0 +1,53 @@
+<?php
+
+class www_SearchTest extends TestBaseApi
+{
+ protected $urlPart = 'search.php';
+
+
+ /**
+ * Some browsers using opensearch do "urlencode" on the terms,
+ * for example Firefox. Multiple terms separated with space
+ * appear as "foo+bar" in the URL.
+ */
+ public function testMultipleTermsUrlEncoded()
+ {
+ $this->addBookmark(null, null, 0, null, 'unittest foo bar');
+ $res = $this->getRequest('/all/foo+bar')->send();
+ $this->assertSelectCount(
+ '.xfolkentry', true, $res->getBody(),
+ 'No bookmark found'
+ );
+
+ $res = $this->getRequest('/all/baz+bat')->send();
+ $this->assertSelectCount(
+ '.xfolkentry', false, $res->getBody(),
+ 'Bookmarks found'
+ );
+ }
+
+
+ /**
+ * Some browsers using opensearch do "rawurlencode" on the terms,
+ * for example Opera. Multiple terms separated with space
+ * appear as "foo%20bar" in the URL.
+ */
+ public function testMultipleTermsRawUrlEncoded()
+ {
+ $this->addBookmark(null, null, 0, null, 'unittest foo bar');
+ $res = $this->getRequest('/all/foo bar')->send();
+ $this->assertSelectCount(
+ '.xfolkentry', true, $res->getBody(),
+ 'No bookmark found'
+ );
+
+ $res = $this->getRequest('/all/baz bat')->send();
+ $this->assertSelectCount(
+ '.xfolkentry', false, $res->getBody(),
+ 'Bookmarks found'
+ );
+ }
+
+}
+
+?> \ No newline at end of file