function FieldRdfaTestBase::parseContent

Same name in other branches
  1. 8.9.x core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php \Drupal\Tests\rdf\Kernel\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/tests/src/Kernel/Field/FieldRdfaTestBase.php
Performs an xpath search on a certain content.

File

core/modules/rdf/tests/src/Kernel/Field/FieldRdfaTestBase.php, line 138

Class

FieldRdfaTestBase

Namespace

Drupal\Tests\rdf\Kernel\Field

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.