'%type' => 'TypeError',
'@message' => 'Drupal\error_test\Controller\ErrorTestController::Drupal\error_test\Controller\{closure}(): Argument #1 ($test) must be of type array, string given, called in ' . \Drupal::
root() . '/core/modules/system/tests/modules/error_test/src/Controller/ErrorTestController.php on line 65',
'%function' => 'Drupal\error_test\Controller\ErrorTestController->Drupal\error_test\Controller\{closure}()',
];
$this->
drupalGet('error-test/generate-fatals'
);
$this->
assertSession()->
statusCodeEquals(500
);
$message =
new FormattableMarkup('%type: @message in %function (line ',
$fatal_error);
$this->
assertSession()->
responseContains((string) $message);
$this->
assertSession()->
responseContains('<pre class="backtrace">'
);
// Ensure we are escaping but not double escaping.
$this->
assertSession()->
responseContains('>'
);
$this->
assertSession()->
responseNotContains('&gt;'
);
} /**
* Tests uncaught exception handling with custom exception handler.
*/
public function testUncaughtExceptionCustomExceptionHandler() { $settings_filename =
$this->siteDirectory . '/settings.php';
chmod($settings_filename, 0777
);
$settings_php =
file_get_contents($settings_filename);
$settings_php .= "\n";
$settings_php .= "set_exception_handler(function() {\n";