public function MetaInformationTest::getSiteMapDomElements in Thunder 6.1.x
Same name and namespace in other branches
- 8.5 tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::getSiteMapDomElements()
- 8.2 tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::getSiteMapDomElements()
- 8.3 tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::getSiteMapDomElements()
- 8.4 tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::getSiteMapDomElements()
- 6.2.x tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::getSiteMapDomElements()
- 6.0.x tests/src/FunctionalJavascript/MetaInformationTest.php \Drupal\Tests\thunder\FunctionalJavascript\MetaInformationTest::getSiteMapDomElements()
Get SiteMap dom elements by XPath.
Parameters
string $content: XML string content of Site Map.
string $xpathQuery: XPath to fetch elements from Site Map.
Return value
\DOMNodeList Returns list of elements matching provided XPath.
1 call to MetaInformationTest::getSiteMapDomElements()
- MetaInformationTest::testSiteMap in tests/
src/ FunctionalJavascript/ MetaInformationTest.php - Test Site Map for Article.
File
- tests/
src/ FunctionalJavascript/ MetaInformationTest.php, line 309
Class
- MetaInformationTest
- Testing of Meta Information.
Namespace
Drupal\Tests\thunder\FunctionalJavascriptCode
public function getSiteMapDomElements($content, $xpathQuery) {
$domDoc = new \DOMDocument();
$domDoc
->loadXML($content);
$xpath = new \DOMXpath($domDoc);
$xpath
->registerNamespace('sm', 'http://www.sitemaps.org/schemas/sitemap/0.9');
$elements = $xpath
->query($xpathQuery);
return $elements;
}