I'm running some unit tests with Codeception. Specifically, I'm testing an API and one of the test steps is failing. I know which step it is but can't figure out why so I want to step into my code as it's being executed by the unit test.
I've tried setting "Break at first line in php scripts", I've debugged the test itself, I've tried writing to the console but there's a lot to narrow down. Is there a way to step into my code like I was debugging normally?
When debugging an API where the request is coming from an external source (not starting a process from within PhpStorm) you can always add ?XDEBUG_SESSION_START=PHPSTORM
to the query string which should start the debugger.
If it doesn't work set it to start at first line of the script and step through. If it doesn't work with the query string it's most often it's because I don't have the correct path mappings set up which you can do from the Settings > Servers.
For anyone else looking at this, as @Brandon mentioned in the comments the first thing you should be sure of is that you have xdebug installed and configured.