protected function TextPlainUnitTest::assertNoText

Asserts that a text string does not appear in the text-only version of $this->content.

Parameters

string $value: The text string to look for.

string $message: (optional) An assertion message. If omitted, a default message is used. Available placeholders:

  • @value: The $value.
  • @content: The current value of $this->content.

array $args: (optional) Additional replacement token map to pass to formatString().

Return value

bool TRUE on pass, FALSE on fail.

File

drupal/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php, line 280
Contains \Drupal\text\Tests\Formatter\TextPlainUnitTest.

Class

TextPlainUnitTest
Tests the text_plain field formatter.

Namespace

Drupal\text\Tests\Formatter

Code

protected function assertNoText($value, $message = NULL, $args = array()) {
  if (!isset($message)) {
    $message = 'Text string @value not found in @content';
  }
  $content = $this
    ->getPlainTextContent($this->content);
  $args += array(
    '@value' => $value,
    '@content' => $content,
  );
  return $this
    ->assert(strpos($content, $value) === FALSE, $this
    ->formatString($message, $args));
}