Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3396710
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3396710
Commits
bc8f01f4
Verified
Commit
bc8f01f4
authored
2 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3294076
by longwave: Remove unused ExceptionTestSiteSubscriber
parent
ddd29c4c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/core.services.yml
+0
-4
0 additions, 4 deletions
core/core.services.yml
core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php
+0
-63
0 additions, 63 deletions
...upal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php
with
0 additions
and
67 deletions
core/core.services.yml
+
0
−
4
View file @
bc8f01f4
...
...
@@ -1300,10 +1300,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
:
...
...
This diff is collapsed.
Click to expand it.
core/lib/Drupal/Core/EventSubscriber/ExceptionTestSiteSubscriber.php
deleted
100644 → 0
+
0
−
63
View file @
ddd29c4c
<?php
namespace
Drupal\Core\EventSubscriber
;
use
Drupal\Core\Utility\Error
;
use
Symfony\Component\HttpKernel\Event\ExceptionEvent
;
/**
* Custom handling of errors when in a system-under-test.
*/
class
ExceptionTestSiteSubscriber
extends
HttpExceptionSubscriberBase
{
/**
* {@inheritdoc}
*/
protected
static
function
getPriority
()
{
return
3
;
}
/**
* {@inheritdoc}
*/
protected
function
getHandledFormats
()
{
return
[
'html'
];
}
/**
* Checks for special handling of errors inside Simpletest.
*
* @todo The $headers array appears to not actually get used at all in the
* original code. It's quite possible that this entire method is now
* vestigial and can be removed.
*
* @param \Symfony\Component\HttpKernel\Event\ExceptionEvent $event
* The event.
*/
public
function
on500
(
ExceptionEvent
$event
)
{
$exception
=
$event
->
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
++
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment