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:
<phpunit bootstrap="tests/bootstrap.php" colors="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutChangesToGlobalState="true"
checkForUnintentionallyCoveredCode="false"
printerClass="\Drupal\Tests\Listeners\HtmlOutputPrinter">
<php>
<!-- Set error reporting to E_ALL. -->
<ini name="error_reporting" value="32767"/>
<!-- Do not limit the amount of memory tests take to run. -->
<ini name="memory_limit" value="-1"/>
<!-- Example SIMPLETEST_BASE_URL value: http://localhost -->
<!-- Example SIMPLETEST_DB value: mysql://username:password@localhost/databasename#table_prefix -->
<env name="SIMPLETEST_DB" value="mysql://root:password@localhost/pbt-d8"/>
<env name="SIMPLETEST_BASE_URL" value="http://pbt-d8"/>
<!-- Example BROWSERTEST_OUTPUT_DIRECTORY value: /path/to/webroot/sites/simpletest/browser_output -->
<env name="BROWSERTEST_OUTPUT_DIRECTORY" value="/home/peter/d8-tests"/>
<env name="PHP_IDE_CONFIG" value="serverName=pbt-d8"/>
<env name="XDEBUG_CONFIG" value="remote_enable=1 remote_mode=req remote_port=9000 remote_host=127.0.0.1 remote_connect_back=0"/>
</php>
</phpunit>
Do you know what's wrong here? Do I need any specific XDebug configuration to fix this issue here?