protected function FieldWebTest::parseContent in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/tests/src/Functional/Handler/FieldWebTest.php \Drupal\Tests\views\Functional\Handler\FieldWebTest::parseContent()
- 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 176
Class
- FieldWebTest
- Tests fields from within a UI.
Namespace
Drupal\Tests\views\Functional\HandlerCode
protected function parseContent($content) {
$htmlDom = new \DOMDocument();
@$htmlDom
->loadHTML('<?xml encoding="UTF-8">' . $content);
$elements = simplexml_import_dom($htmlDom);
return $elements;
}