Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
drupal
Commits
9107f06d
Commit
9107f06d
authored
11 years ago
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2134259
by tstoeckler: Make the Simpletest XDebug integration work for CLI requests.
parent
3cda8309
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+17
-4
17 additions, 4 deletions
.../modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
with
17 additions
and
4 deletions
core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+
17
−
4
View file @
9107f06d
...
...
@@ -1132,15 +1132,28 @@ protected function curlExec($curl_options, $redirect = FALSE) {
if
(
!
empty
(
$this
->
curlCookies
))
{
$cookies
=
$this
->
curlCookies
;
}
// In order to debug webtests you need to either set a cookie or have the
// xdebug session in the URL. If the developer listens to connection on the
// parent site, by default the cookie is not forwarded to the client side,
// so you can't debug actual running code. In order to make debuggers work
// In order to debug web tests you need to either set a cookie, have the
// Xdebug session in the URL or set an environment variable in case of CLI
// requests. If the developer listens to connection on the parent site, by
// default the cookie is not forwarded to the client side, so you cannot
// debug the code running on the child site. In order to make debuggers work
// this bit of information is forwarded. Make sure that the debugger listens
// to at least three external connections.
if
(
isset
(
$_COOKIE
[
'XDEBUG_SESSION'
]))
{
$cookies
[]
=
'XDEBUG_SESSION='
.
$_COOKIE
[
'XDEBUG_SESSION'
];
}
// For CLI requests, the information is stored in $_SERVER.
if
(
isset
(
$_SERVER
[
'XDEBUG_CONFIG'
]))
{
// $_SERVER['XDEBUG_CONFIG'] has the form "key1=value1 key2=value2 ...".
$pairs
=
explode
(
' '
,
$_SERVER
[
'XDEBUG_CONFIG'
]);
foreach
(
$pairs
as
$pair
)
{
list
(
$key
,
$value
)
=
explode
(
'='
,
$pair
);
// Account for key-value pairs being separated by multiple spaces.
if
(
trim
(
$key
,
' '
)
==
'idekey'
)
{
$cookies
[]
=
'XDEBUG_SESSION='
.
trim
(
$value
,
' '
);
}
}
}
// Merge additional cookies in.
if
(
!
empty
(
$cookies
))
{
...
...
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