summaryrefslogtreecommitdiff
path: root/tests/Api
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-04-14 17:04:57 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-04-14 17:04:57 +0200
commit5d22905ce7eb97d60c3dafddc3e96136a2b94436 (patch)
treeb31313e54cae6e0bbe1e66a2fd85092d72c33aa6 /tests/Api
parent8a87a245b8bba49abd6ad7f9f457c421b09d9e30 (diff)
downloadsemanticscuttle-5d22905ce7eb97d60c3dafddc3e96136a2b94436.tar.gz
semanticscuttle-5d22905ce7eb97d60c3dafddc3e96136a2b94436.tar.bz2
verify we get the correct search URL
Diffstat (limited to 'tests/Api')
-rw-r--r--tests/Api/OpenSearchTest.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/Api/OpenSearchTest.php b/tests/Api/OpenSearchTest.php
index a242319..050713b 100644
--- a/tests/Api/OpenSearchTest.php
+++ b/tests/Api/OpenSearchTest.php
@@ -54,6 +54,23 @@ class Api_OpenSearchTest extends TestBaseApi
);
}
+ public function testOpenSearchSearchUrl()
+ {
+ $xml = $this->getRequest('api/opensearch.php')->send()->getBody();
+ $x = simplexml_load_string($xml);
+ $x->registerXPathNamespace('os', reset($x->getDocNamespaces()));
+
+ $arElements = $x->xpath('//os:Url[@type="text/html"]');
+ $this->assertEquals(
+ 1, count($arElements),
+ 'Url in OpenSearch description is missing'
+ );
+ $this->assertEquals(
+ $GLOBALS['unittestUrl'] . 'search.php/all/{searchTerms}',
+ (string)$arElements[0]['template']
+ );
+ }
+
}
?> \ No newline at end of file