You are here

protected function UncaughtExceptionTest::assertText in Drupal 8

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.

Deprecated in drupal:8.2.0 and is removed from drupal:10.0.0. Use

  • $this->assertSession()->responseContains() for non-HTML responses, like XML or Json.
  • $this->assertSession()->pageTextContains() for HTML responses. Unlike the deprecated assertText(), the passed text should be HTML decoded, exactly as a human sees it in the browser.

Overrides AssertLegacyTrait::assertText

4 calls to UncaughtExceptionTest::assertText()
UncaughtExceptionTest::assertRaw in core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
Passes if the raw text IS found on the loaded page, fail otherwise.
UncaughtExceptionTest::testLoggerException in core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
Tests fallback to PHP error log when an exception is thrown while logging.
UncaughtExceptionTest::testUncaughtException in core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
Tests uncaught exception handling when system is in a bad state.
UncaughtExceptionTest::testUncaughtExceptionCustomExceptionHandler in core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php
Tests uncaught exception handling with custom exception handler.

File

core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php, line 373

Class

UncaughtExceptionTest
Tests kernel panic when things are really messed up.

Namespace

Drupal\FunctionalTests\Bootstrap

Code

protected function assertText($text) {
  $this
    ->assertStringContainsString($text, $this->response);
}