function StyleTestBase::storeViewPreview

Stores a view output in the elements.

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

File

drupal/core/modules/views/lib/Drupal/views/Tests/Plugin/StyleTestBase.php, line 27
Definition of Drupal\views\Tests\Plugin\StyleTestBase.

Class

StyleTestBase
Tests some general style plugin related functionality.

Namespace

Drupal\views\Tests\Plugin

Code

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);
  }
}