protected function 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 drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php
Performs an xpath search on a certain content.

File

drupal/core/modules/views/lib/Drupal/views/Tests/Handler/FieldWebTest.php, line 135
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;
}