4

PHP, XDebug, and my IDE (PhpStorm) are all configured properly. PhpStorm is listening, and it's picking up the debug session, but it never hits the breakpoint in my unit test class and I'm unable to step through it. The entire test runs.

Anyone have any ideas?

2
  • Do you have another scripts that you can run and they step into breakpoints? Did you tried "Force break at the first line when no path mappings specified" (maybe there is something with mapping)? Commented Jan 28, 2016 at 16:19
  • Yep, I can run a regular script from the CLI and it will hit any breakpoints I've defined. I also have the option for "Force break at the first line when no path mapping specified" checked, still no dice. Commented Jan 28, 2016 at 17:08

1 Answer 1

4

I can step into PHPUnit tests without a problem using XDebug. However, I did notice that it sometimes seems to skip certain statements (such as simple assignment to variables in a function without anything else), so spread some breakpoints around.

Make sure you've set up path mapping properly, with the correct version of the library mapped over.

If you're using XDebug from the command-line, you have to set certain environment variables - see here and here.

In my case, the following environment variables needed to be set in the remote box and run from the remote box. 10.0.2.2 works OK for Virtualbox VMs - basically you need to point to your local machine.

export XDEBUG_CONFIG="idekey=PHPSTORM remote_host=10.0.2.2 remote_port=9000"
export PHP_IDE_CONFIG="serverName=[yourservernamehere]"

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Though I solved this long ago, I failed to answer my own question with the solution. Since you mentioned the solution in your answer, I've accepted it as the answer. FYI, the solution was running export PHP_IDE_CONFIG="serverName=[yourservernamehere]"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.