You are here

protected function FieldWebTest::parseContent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Tests/Handler/FieldWebTest.php \Drupal\views\Tests\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/src/Tests/Handler/FieldWebTest.php
Performs an xpath search on a certain content.

File

core/modules/views/src/Tests/Handler/FieldWebTest.php, line 157
Contains \Drupal\views\Tests\Handler\FieldWebTest.

Class

FieldWebTest
Tests fields from within a UI.

Namespace

Drupal\views\Tests\Handler

Code

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