I have a local ddev (docker based) PHP Drupal 7 development environment set up. I have set up Behat tests for this site utilizing the Behat Drupal Extension.
All of the Behat context files and the associated composer vendor folder lives outside of the site's web root in a testing folder. The folder structure looks something like:
-
Project
testing
public_html
I have xdebug enabled and using PhpStorm. I have set up a PhpStorm debug server and provided correct path mappings.
Debugging php code via a browser works great, debugging CLI commands works great. My issue occurs when I try to debug all code while running Behat tests via the CLI.
In the PhpStorm PHP Server configuration if I only set the path mappings for the testing
folder I can debug any code within the testing folder and there are no curl issues. I obviously can't debug code in the public_html
folder because I have not set the path mappings. When I do set the path mappings for both the testing
and public_html
folders, I can debug all code but any behat step definition that includes a Mink curl_exec()
call to the site's local url, hangs for anywhere from 3 to 10 minutes!
My goal...
To be able to debug all php code in the testing
and public_html
folders while running Behat tests without curl_exec()
hanging.
What I have tried...
I have PhpStorm Debug Max Simultaneous Connections set to 10 and have tried 20.
Here are my xdebug remote config settings:
xdebug.remote_addr_header => no value => no value
xdebug.remote_autostart => On => On
xdebug.remote_connect_back => Off => Off
xdebug.remote_cookie_expire_time => 3600 => 3600
xdebug.remote_enable => On => On
xdebug.remote_handler => dbgp => dbgp
xdebug.remote_host => host.docker.internal => host.docker.internal
xdebug.remote_log => no value => no value
xdebug.remote_mode => req => req
xdebug.remote_port => 9000 => 9000
All of the following have all resulted in curl hanging:
- Set
xdebug.remote_autostart=0
and started the Xdebug session by passing aXDEBUG_CONFIG=idekey=PHPSTORM
environment variable in with my behat command AND- NOT passing any cookie or GET parameter with the curl call.
- Passing the same idekey as a cookie and GET parameter with the curl call
- Passing a different idekey as a cookie and GET parameter with the curl call
Any help is greatly appreciated!!