diff options
author | Christian Weiske <cweiske@cweiske.de> | 2011-05-02 18:07:15 +0200 |
---|---|---|
committer | Christian Weiske <cweiske@cweiske.de> | 2011-05-02 18:07:15 +0200 |
commit | 8be81abfe6193e221afcdc35582d34505797a7b8 (patch) | |
tree | 95ae7e30d40596f27875adb2f96a15fc827f9f86 /tests/www/searchTest.php | |
parent | f629d081ddf52e3cb83ffbfc973a97adc691790c (diff) | |
parent | 40b4674e471f8b0fbdc77a26eec86018e2ab03ea (diff) | |
download | semanticscuttle-8be81abfe6193e221afcdc35582d34505797a7b8.tar.gz semanticscuttle-8be81abfe6193e221afcdc35582d34505797a7b8.tar.bz2 |
merge master
Diffstat (limited to 'tests/www/searchTest.php')
-rw-r--r-- | tests/www/searchTest.php | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/www/searchTest.php b/tests/www/searchTest.php new file mode 100644 index 0000000..1220667 --- /dev/null +++ b/tests/www/searchTest.php @@ -0,0 +1,68 @@ +<?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', false + ); + + $res = $this->getRequest('/all/baz+bat')->send(); + $this->assertSelectCount( + '.xfolkentry', false, $res->getBody(), + 'Bookmarks found', false + ); + } + + + /** + * 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%20bar')->send(); + $this->assertSelectCount( + '.xfolkentry', true, $res->getBody(), + 'No bookmark found', false + ); + + $res = $this->getRequest('/all/baz bat')->send(); + $this->assertSelectCount( + '.xfolkentry', false, $res->getBody(), + 'Bookmarks found', false + ); + } + + + public function testMultipleTags() + { + $this->markTestSkipped( + 'FIXME: SemanticScuttle currently does not search multiple tags' + ); + + $this->addBookmark(null, null, 0, array('foo', 'bar')); + $res = $this->getRequest('/all/foo+bar')->send(); + $this->assertSelectCount( + '.xfolkentry', true, $res->getBody(), + 'No bookmark found', false + ); + } + +} + +?>
\ No newline at end of file |