Debugging Behat with PHPSTORM

has anyone managed to Debug Behat Features/Scenarios with PHPSTORM?

I have the following configuration:
- Projects files are on my local windows machine
- SFTP Deployment to my development server
- Configured Remote PHP Interpreter from dev server
- XDEBUG is up and running on the dev server
- Listening for "normal" PHP  debug connections is working
- Running Beaht tests in the PHPSTORM console is working (sftp://phpdev@xxxxx:22/usr/bin/php /home/phpdev/.phpstorm_helpers/behat.php --format PhpStormBehatFormatter --config /var/www/phpdev/behat.yml)
- Debugging gives me the following Error: Remote file path 'home/phpdev/.phpstorm_helpers/behat.php' is not mapped to any file path in project

Any help is greatly appreciated!


Comment actions Permalink

Please configura mappings in the File | Settings (Preferences for Mac OS) | Languages&Frameworks | PHP | Servers.

Comment actions Permalink

Seeing the same thing here.  There is no /.phpstorm_helpers/behat.php  in the project so configuring mappings is not going to help, the file doesn't exist in the project.

One way I can make it work is to run the test from the command line on the remote server, then debugging will work.  Make sure you have the xdebug info added to the CLI version of php.ini on the remote server pointing back to your local dev machine.

I still haven't got debugging working from phpstorm run configurations yet.  Will update if I can get it working.

--- edit ---

It is possible to copy that .phpstorm_helpers/behat.php into the project directory, then map it, and debug it, but the goal is not to debug phpstorm's behat helper, but rather the php files that are running, so mapping to that file is of little use.

--- edit edit ---

The solution is to click on the DEBUG icon instead of the RUN icon for the profile you have just created.  It will run the same, but will stop at breakpoints.


Please sign in to leave a comment.