You are here

protected function StyleTest::storeViewPreview in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Plugin/StyleTest.php \Drupal\views\Tests\Plugin\StyleTest::storeViewPreview()

Stores a view output in the elements.

1 call to StyleTest::storeViewPreview()
StyleTest::testCustomRowClasses in core/modules/views/src/Tests/Plugin/StyleTest.php
Tests custom css classes.

File

core/modules/views/src/Tests/Plugin/StyleTest.php, line 289
Contains \Drupal\views\Tests\Plugin\StyleTest.

Class

StyleTest
Tests general style functionality.

Namespace

Drupal\views\Tests\Plugin

Code

protected function storeViewPreview($output) {
  $htmlDom = new \DOMDocument();
  @$htmlDom
    ->loadHTML($output);
  if ($htmlDom) {

    // It's much easier to work with simplexml than DOM, luckily enough
    // we can just simply import our DOM tree.
    $this->elements = simplexml_import_dom($htmlDom);
  }
}