You are here

function StyleTestBase::storeViewPreview in Zircon Profile 8

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

Stores a view output in the elements.

2 calls to StyleTestBase::storeViewPreview()
StyleMappingTest::mappedOutputHelper in core/modules/views/src/Tests/Plugin/StyleMappingTest.php
Tests the mapping of fields.
StyleUnformattedTest::testDefaultRowClasses in core/modules/views/src/Tests/Plugin/StyleUnformattedTest.php
Make sure that the default css classes works as expected.

File

core/modules/views/src/Tests/Plugin/StyleTestBase.php, line 28
Contains \Drupal\views\Tests\Plugin\StyleTestBase.

Class

StyleTestBase
Tests some general style plugin related functionality.

Namespace

Drupal\views\Tests\Plugin

Code

function storeViewPreview($output) {
  $html5 = new HTML5();
  $htmlDom = $html5
    ->loadHTML('<html><body>' . $output . '</body></html>');
  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);
  }
}