From: Christian Weiske Date: Thu, 14 Apr 2011 15:04:57 +0000 (+0200) Subject: verify we get the correct search URL X-Git-Tag: v0.98.0~80 X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=5d22905ce7eb97d60c3dafddc3e96136a2b94436;p=semanticscuttle.git verify we get the correct search URL --- 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