You are here

protected function AssertContentTrait::getTextContent in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/simpletest/src/AssertContentTrait.php \Drupal\simpletest\AssertContentTrait::getTextContent()

Retrieves the plain-text content from the current raw content.

9 calls to AssertContentTrait::getTextContent()
AssertContentTrait::assertTextHelper in core/modules/simpletest/src/AssertContentTrait.php
Helper for assertText and assertNoText.
AssertContentTrait::assertTextPattern in core/modules/simpletest/src/AssertContentTrait.php
Asserts that a Perl regex pattern is found in the plain-text content.
AssertContentTrait::assertUniqueTextHelper in core/modules/simpletest/src/AssertContentTrait.php
Helper for assertUniqueText and assertNoUniqueText.
BlockContentFieldFilterTest::assertPageCounts in core/modules/block_content/src/Tests/Views/BlockContentFieldFilterTest.php
Asserts that the given block_content translation counts are correct.
CommentFieldFilterTest::assertPageCounts in core/modules/comment/src/Tests/Views/CommentFieldFilterTest.php
Asserts that the given comment translation counts are correct.

... See full list

File

core/modules/simpletest/src/AssertContentTrait.php, line 78
Contains \Drupal\simpletest\AssertContentTrait.

Class

AssertContentTrait
Provides test methods to assert content.

Namespace

Drupal\simpletest

Code

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, array());
  }
  return $this->plainTextContent;
}