verify we get the correct search URL
This commit is contained in:
parent
8a87a245b8
commit
5d22905ce7
1 changed files with 17 additions and 0 deletions
|
@ -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']
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Loading…
Reference in a new issue