How to debug behat functions using xdebug?

It is not an easy time with Behat, cent to find a way to debug (php / xdebug using breakpoints and steps). Does anyone have experience or maybe there is a better way to do the same?

Edited by:

"behat/mink": "*", "behat/mink-extension": "*", "behat/mink-zombie-driver": "*@dev", "behat/mink-selenium2-driver": "*" 

Check the regular function on the website.

+6
source share
2 answers

Before running the tests, you must set the following environment variable:

XDEBUG_CONFIG = "XDEBUG_SESSION_START ="

This works for me.

+1
source
  • In php.ini * find the xdebug section
  • Add another line labeled "xdebug.remote_autostart = 1" Be prepared to comment on this line after you finish testing / debugging cli.

* xdebug section may be harder to find:

  • there may be several php.ini files, for example. one for cli, the other for apache.
  • there may be several php versions
  • xdebug may have a separate file, for example. on some Linux it can be in / etc / php / 7.0 / cli / conf.d / 20-xdebug.ini

As soon as commenting on autorun becomes annoying in the long run, it might be worth investing in some parameterized switch or separate ini files. But I would give myself a week of annoyance before taking this path.

0
source

All Articles