AFAIK you can't. You can use regular debugging. In the latest PhpStorm EAP Behat comes with debugging support, though its still glitchy. You can initiate Xdebug yourself by passing the Xdebug cookie before Mink opens any pages. This should be added to the context.
/**
* @beforeStep
*
* @param BeforeStepScope $scope
*/
public function synchroniseClientSession(BeforeStepScope $scope)
{
$driver = $this->getSession()->getDriver();
// Cookies must be set on the domain we're testing, Chrome opens with 'data:,' in the url.
if ($driver instanceof Selenium2Driver && $driver->getCurrentUrl() === 'data:,') {
$driver->visit($this->getMinkParameter('base_url'));
}
$driver->setCookie('XDEBUG_SESSION', 'PHPSTORM');
}
Default Behat configuration must also receive the environment variable with the idekey
in case you're testing the raw code:
XDEBUG_CONFIG="idekey=PHPSTORM"