You are here

protected function AssertContentTrait::assertText in Zircon Profile 8.0

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

Passes if the page (with HTML stripped) contains the text.

Note that stripping HTML tags also removes their attributes, such as the values of text fields.

Parameters

string $text: Plain text to look for.

string $message: (optional) A message to display with the assertion. Do not translate messages: use \Drupal\Component\Utility\SafeMarkup::format() to embed variables in the message text, not t(). If left blank, a default message will be displayed.

string $group: (optional) The group this message is in, which is displayed in a column in test output. Use 'Debug' to indicate this is debugging output. Do not translate this string. Defaults to 'Other'; most tests do not override this default.

Return value

bool TRUE on pass, FALSE on fail.

See also

\Drupal\simpletest\AssertContentTrait::assertRaw()

603 calls to AssertContentTrait::assertText()
AccessDeniedTest::testAccessDenied in core/modules/system/src/Tests/System/AccessDeniedTest.php
AddFeedTest::testAddFeed in core/modules/aggregator/src/Tests/AddFeedTest.php
Creates and ensures that a feed is unique, checks source, and deletes feed.
AddFeedTest::testAddLongFeed in core/modules/aggregator/src/Tests/AddFeedTest.php
Tests feeds with very long URLs.
AdminTest::testAdminPages in core/modules/system/src/Tests/System/AdminTest.php
Tests output on administrative listing pages.
AggregatorAdminTest::testSettingsPage in core/modules/aggregator/src/Tests/AggregatorAdminTest.php
Tests the settings form to ensure the correct default values are used.

... See full list

File

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

Class

AssertContentTrait
Provides test methods to assert content.

Namespace

Drupal\simpletest

Code

protected function assertText($text, $message = '', $group = 'Other') {
  return $this
    ->assertTextHelper($text, $message, $group, FALSE);
}