You are here

public function StyleTestBase::storeViewPreview in Drupal 9

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

Stores a view output in the elements.

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

File

core/modules/views/tests/src/Kernel/Plugin/StyleTestBase.php, line 23

Class

StyleTestBase
Tests some general style plugin related functionality.

Namespace

Drupal\Tests\views\Kernel\Plugin

Code

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