From a25838b267f76c027318df268797842b52d6ecea Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 15 Apr 2011 07:55:06 +0200 Subject: Fix bug #3097187: Using opensearch with two tags does not work in Firefox --- tests/www/searchTest.php | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 tests/www/searchTest.php (limited to 'tests/www') 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 @@ +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 -- cgit v1.2.3-54-g00ecf From b2c48977bb34f4f59eba06f5b363f281deae2ef0 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 15 Apr 2011 07:56:50 +0200 Subject: use xml parser, not html --- tests/www/searchTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tests/www') diff --git a/tests/www/searchTest.php b/tests/www/searchTest.php index 81eb2cc..e783a49 100644 --- a/tests/www/searchTest.php +++ b/tests/www/searchTest.php @@ -16,13 +16,13 @@ class www_SearchTest extends TestBaseApi $res = $this->getRequest('/all/foo+bar')->send(); $this->assertSelectCount( '.xfolkentry', true, $res->getBody(), - 'No bookmark found' + 'No bookmark found', false ); $res = $this->getRequest('/all/baz+bat')->send(); $this->assertSelectCount( '.xfolkentry', false, $res->getBody(), - 'Bookmarks found' + 'Bookmarks found', false ); } @@ -38,13 +38,13 @@ class www_SearchTest extends TestBaseApi $res = $this->getRequest('/all/foo bar')->send(); $this->assertSelectCount( '.xfolkentry', true, $res->getBody(), - 'No bookmark found' + 'No bookmark found', false ); $res = $this->getRequest('/all/baz bat')->send(); $this->assertSelectCount( '.xfolkentry', false, $res->getBody(), - 'Bookmarks found' + 'Bookmarks found', false ); } -- cgit v1.2.3-54-g00ecf From 0f0a95998e373420549251be86407f9ca478fc1d Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 15 Apr 2011 08:00:26 +0200 Subject: use correct url --- tests/www/searchTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/www') diff --git a/tests/www/searchTest.php b/tests/www/searchTest.php index e783a49..cd7b2a5 100644 --- a/tests/www/searchTest.php +++ b/tests/www/searchTest.php @@ -35,7 +35,7 @@ class www_SearchTest extends TestBaseApi public function testMultipleTermsRawUrlEncoded() { $this->addBookmark(null, null, 0, null, 'unittest foo bar'); - $res = $this->getRequest('/all/foo bar')->send(); + $res = $this->getRequest('/all/foo%20bar')->send(); $this->assertSelectCount( '.xfolkentry', true, $res->getBody(), 'No bookmark found', false -- cgit v1.2.3-54-g00ecf From a1989cff0675642146e0ba52aac4c6b10cdd9ae5 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Fri, 15 Apr 2011 19:15:57 +0200 Subject: add test to search for multiple tags, which fails currently --- tests/www/searchTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/www') diff --git a/tests/www/searchTest.php b/tests/www/searchTest.php index cd7b2a5..1220667 100644 --- a/tests/www/searchTest.php +++ b/tests/www/searchTest.php @@ -48,6 +48,21 @@ class www_SearchTest extends TestBaseApi ); } + + 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 -- cgit v1.2.3-54-g00ecf