Question

Having hard time with Behat, cent find the way to debug (php/xdebug using breakpoints and steps). Does anybody have experience or maybe there is better way to do the same?

Edited:

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

Testing regular feature on website.

Was it helpful?

Solution

You should set the following environment variable before launching your tests:

XDEBUG_CONFIG="XDEBUG_SESSION_START="

It works for me.

OTHER TIPS

  1. In php.ini* find xdebug section
  2. Add another line saying "xdebug.remote_autostart=1" Be ready to comment this line out after you're done with cli testing / debugging.

* the xdebug section may be harder to locate:

  1. there may be multiple php.ini files, e.g. one for cli, another for apache.
  2. there may be multiple php versions
  3. the xdebug may have it's separate file, e.g. on some linuxes it could be under /etc/php/7.0/cli/conf.d/20-xdebug.ini

Once commenting the autostart gets annoying in the long run, it may be worth investing in some parametrized switch or separate ini files. But I would give myself a week of annoyance before going down this path.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top