function StyleTest::getHtmlDom
Returns a view output as SimpleXMLElement.
Return value
\SimpleXMLElement|null The HTML DOM.
1 call to StyleTest::getHtmlDom()
- StyleTest::testCustomRowClasses in core/
modules/ views/ tests/ src/ Kernel/ Plugin/ StyleTest.php  - Tests custom CSS row classes.
 
File
- 
              core/
modules/ views/ tests/ src/ Kernel/ Plugin/ StyleTest.php, line 311  
Class
- StyleTest
 - Tests general style functionality.
 
Namespace
Drupal\Tests\views\Kernel\PluginCode
protected function getHtmlDom($output) {
  $html_dom = new \DOMDocument();
  @$html_dom->loadHTML($output);
  if ($html_dom) {
    // It's much easier to work with simplexml than DOM, luckily enough
    // we can just simply import our DOM tree.
    return simplexml_import_dom($html_dom);
  }
  return NULL;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.