You are here

protected function UncaughtExceptionTest::error in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/System/UncaughtExceptionTest.php \Drupal\system\Tests\System\UncaughtExceptionTest::error()

Fire an error assertion.

Parameters

$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.

$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.

$caller: The caller of the error.

Return value

FALSE.

Overrides TestBase::error

File

core/modules/system/src/Tests/System/UncaughtExceptionTest.php, line 276
Contains \Drupal\system\Tests\System\UncaughtExceptionTest.

Class

UncaughtExceptionTest
Tests kernel panic when things are really messed up.

Namespace

Drupal\system\Tests\System

Code

protected function error($message = '', $group = 'Other', array $caller = NULL) {
  if (!empty($this->expectedExceptionMessage) && strpos($message, $this->expectedExceptionMessage) !== FALSE) {

    // We're expecting this error.
    return FALSE;
  }
  return parent::error($message, $group, $caller);
}