From d0ab08fb9e7d2b503874997f2eaeb51a0047a51f Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Mon, 4 Jul 2022 16:23:06 +0100 Subject: [PATCH] Issue #3294076 by longwave: Remove unused ExceptionTestSiteSubscriber (cherry picked from commit bc8f01f49dbb4ea07c3abfb93fe15c434d9c34f2) --- core/core.services.yml | 4 -- .../ExceptionTestSiteSubscriber.php | 63 ------------------- 2 files changed, 67 deletions(-) delete mode 100644 core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php diff --git a/core/core.services.yml b/core/core.services.yml index 32fefbc281c3..62ec05ff5748 100644 --- a/core/core.services.yml +++ b/core/core.services.yml @@ -1332,10 +1332,6 @@ services: tags: - { name: event_subscriber } arguments: ['@config.factory', '@http_kernel'] - exception.test_site: - class: Drupal\Core\EventSubscriber\ExceptionTestSiteSubscriber - tags: - - { name: event_subscriber } exception.enforced_form_response: class: Drupal\Core\EventSubscriber\EnforcedFormResponseSubscriber tags: diff --git a/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php deleted file mode 100644 index 2f9745c5c88f..000000000000 --- a/core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php +++ /dev/null @@ -1,63 +0,0 @@ -getThrowable(); - $error = Error::decodeException($exception); - - $headers = []; - - // When running inside the testing framework, we relay the errors - // to the tested site by the way of HTTP headers. - if (DRUPAL_TEST_IN_CHILD_SITE && !headers_sent() && (!defined('SIMPLETEST_COLLECT_ERRORS') || SIMPLETEST_COLLECT_ERRORS)) { - // $number does not use drupal_static as it should not be reset - // as it uniquely identifies each PHP error. - static $number = 0; - $assertion = [ - $error['@message'], - $error['%type'], - [ - 'function' => $error['%function'], - 'file' => $error['%file'], - 'line' => $error['%line'], - ], - ]; - $headers['X-Drupal-Assertion-' . $number] = rawurlencode(serialize($assertion)); - $number++; - } - } - -}