protected function AssertContentTrait::getTextContent in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::getTextContent()
- 9 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::getTextContent()
Retrieves the plain-text content from the current raw content.
1 call to AssertContentTrait::getTextContent()
- TestClass::_getTextContent in core/
tests/ Drupal/ Tests/ Core/ Test/ AssertContentTraitTest.php
File
- core/
tests/ Drupal/ KernelTests/ AssertContentTrait.php, line 73
Class
- AssertContentTrait
- Provides test methods to assert content.
Namespace
Drupal\KernelTestsCode
protected function getTextContent() {
if (!isset($this->plainTextContent)) {
$raw_content = $this
->getRawContent();
// Strip everything between the HEAD tags.
$raw_content = preg_replace('@<head>(.+?)</head>@si', '', $raw_content);
$this->plainTextContent = Xss::filter($raw_content, []);
}
return $this->plainTextContent;
}