From 5d22905ce7eb97d60c3dafddc3e96136a2b94436 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Thu, 14 Apr 2011 17:04:57 +0200 Subject: verify we get the correct search URL --- tests/Api/OpenSearchTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 -- cgit v1.2.3