Running PHPUnit test from CLI and debug in PhpStorm: Remote file path '/directory/path/-' is not mapped to any file in project I'm trying to execute a PHPUnit test via the CLI to debug in via PhpStorm, being on a Ubuntu 16.04 operating system. It's a KernelTestBase unit test for Drupal 8. The normal execution of the test - without PhpStorm and Xdebug - works. The problem appears, when I have XDebug switched on. I'm executing it that way from the terminal:


  peter@computer ~/Websites/pbt-d8 $ vendor/bin/phpunit -c
  modules/permissions_by_term
  modules/permissions_by_term/tests/src/Kernel/SelectTermTest.php


If XDebug is switched on, PhpStorm shows me a weird "Remote file path error":


  Remote file path '/home/peter/Websites/pbt-d8/-' is not mapped to any
  file path in project


I have also attached a screenshot of the debug window: 


What confuses me here, is the "-" character at the end of the path. I have not specified this character anywhere. 

I have no idea what I should define here as a path mapping within PhpStorm:


My phpunit.xml file (which is located at modules/permissions_by_term/phpunit.xml) looks like follows:

&lt;phpunit bootstrap="tests/bootstrap.php" colors="true"
         beStrictAboutTestsThatDoNotTestAnything="true"
         beStrictAboutOutputDuringTests="true"
         beStrictAboutChangesToGlobalState="true"
         checkForUnintentionallyCoveredCode="false"
         printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter"&gt;
  &lt;php&gt;
    &lt;!-- Set error reporting to E_ALL. --&gt;
    &lt;ini name="error_reporting" value="32767"/&gt;
    &lt;!-- Do not limit the amount of memory tests take to run. --&gt;
    &lt;ini name="memory_limit" value="-1"/&gt;
    &lt;!-- Example SIMPLETEST_BASE_URL value: http://localhost --&gt;
    &lt;!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix --&gt;
    &lt;env name="SIMPLETEST_DB" value="mysql://root:password@localhost/pbt-d8"/&gt;
    &lt;env name="SIMPLETEST_BASE_URL" value="http://pbt-d8"/&gt;
    &lt;!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output --&gt;
    &lt;env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/home/peter/d8-tests"/&gt;
    &lt;env name="PHP_IDE_CONFIG" value="serverName=pbt-d8"/&gt;
    &lt;env name="XDEBUG_CONFIG" value="remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0"/&gt;
  &lt;/php&gt;
&lt;/phpunit&gt;


Do you know what's wrong here? Do I need any specific XDebug configuration to fix this issue here?
You can disable "Force break at first line when no path mapping specified" in "Debug" settings and this error goes away. While execution is paused, you can see that the break is happening in a secondary callback that is called with - as an argument (See $_SERVER['argv'][0]).

This doesn't happen with purely unit tests because there isn't a secondary callback but BrowserTestBase. KernelTestBase must be working simillarly to BrowserTestBase.