You are here

protected function FieldWebTest::parseContent in Drupal 8

Same name and namespace 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()

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