You are here

protected function TestControllers::removeExceptionLogger in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/router_test_directory/src/TestControllers.php \Drupal\router_test\TestControllers::removeExceptionLogger()
2 calls to TestControllers::removeExceptionLogger()
TestControllers::test10 in core/modules/system/tests/modules/router_test_directory/src/TestControllers.php
Test controller for ExceptionHandlingTest::testBacktraceEscaping().
TestControllers::test24 in core/modules/system/tests/modules/router_test_directory/src/TestControllers.php

File

core/modules/system/tests/modules/router_test_directory/src/TestControllers.php, line 122
Contains \Drupal\router_test\TestControllers.

Class

TestControllers
Controller routines for testing the routing system.

Namespace

Drupal\router_test

Code

protected function removeExceptionLogger() {

  // Remove the exception logger from the event dispatcher. We are going to
  // throw an exception to check if it is properly escaped when rendered as a
  // backtrace. The exception logger does a call to error_log() which is not
  // handled by the Simpletest error handler and would cause a test failure.
  $event_dispatcher = \Drupal::service('event_dispatcher');
  $exception_logger = \Drupal::service('exception.logger');
  $event_dispatcher
    ->removeSubscriber($exception_logger);
}