function FieldWebTest::parseContent

Same name in other branches
  1. 9 core/modules/views/tests/src/Functional/Handler/FieldWebTest.php \Drupal\Tests\views\Functional\Handler\FieldWebTest::parseContent()
  2. 10 core/modules/views/tests/src/Functional/Handler/FieldWebTest.php \Drupal\Tests\views\Functional\Handler\FieldWebTest::parseContent()
  3. 11.x core/modules/views/tests/src/Functional/Handler/FieldWebTest.php \Drupal\Tests\views\Functional\Handler\FieldWebTest::parseContent()

Parse a content and return the html element.

Parameters

string $content: The html to parse.

Return value

array An array containing simplexml objects.

1 call to FieldWebTest::parseContent()
FieldWebTest::xpathContent in core/modules/views/tests/src/Functional/Handler/FieldWebTest.php
Performs an xpath search on a certain content.

File

core/modules/views/tests/src/Functional/Handler/FieldWebTest.php, line 164

Class

FieldWebTest
Tests fields from within a UI.

Namespace

Drupal\Tests\views\Functional\Handler

Code

protected function parseContent($content) {
    $htmlDom = new \DOMDocument();
    @$htmlDom->loadHTML('<?xml encoding="UTF-8">' . $content);
    $elements = simplexml_import_dom($htmlDom);
    return $elements;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.