You are here

protected function FieldRdfaTestBase::parseContent in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php \Drupal\rdf\Tests\Field\FieldRdfaTestBase::parseContent()

Parses 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 FieldRdfaTestBase::parseContent()
FieldRdfaTestBase::xpathContent in core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php
Performs an xpath search on a certain content.

File

core/modules/rdf/src/Tests/Field/FieldRdfaTestBase.php, line 152
Contains \Drupal\rdf\Tests\Field\FieldRdfaTestBase.

Class

FieldRdfaTestBase

Namespace

Drupal\rdf\Tests\Field

Code

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