protected function TextPlainUnitTest::assertRaw

Asserts that a raw string appears in $this->content.

Parameters

string $value: The raw 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.

1 call to TextPlainUnitTest::assertRaw()
TextPlainUnitTest::testPlainText in drupal/core/modules/text/lib/Drupal/text/Tests/Formatter/TextPlainUnitTest.php
Tests text_plain formatter output.

File

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

Class

TextPlainUnitTest
Tests the text_plain field formatter.

Namespace

Drupal\text\Tests\Formatter

Code

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