You are here

protected function UncaughtExceptionTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Bootstrap/UncaughtExceptionTest.php \Drupal\FunctionalTests\Bootstrap\UncaughtExceptionTest::setUp()

Overrides BrowserTestBase::setUp

File

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

Class

UncaughtExceptionTest
Tests kernel panic when things are really messed up.

Namespace

Drupal\FunctionalTests\Bootstrap

Code

protected function setUp() {
  parent::setUp();
  $settings_filename = $this->siteDirectory . '/settings.php';
  chmod($settings_filename, 0777);
  $settings_php = file_get_contents($settings_filename);
  $settings_php .= "\ninclude_once 'core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php';\n";
  $settings_php .= "\ninclude_once 'core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php';\n";
  file_put_contents($settings_filename, $settings_php);
  $settings = [];
  $settings['config']['system.logging']['error_level'] = (object) [
    'value' => ERROR_REPORTING_DISPLAY_VERBOSE,
    'required' => TRUE,
  ];
  $this
    ->writeSettings($settings);
}