1

I can successfully run Unit tests via PhpStorm, but when I run them in Debug Mode it fails with following error:

Xdebug: [Step Debug] Time-out connecting to debugging client, waited: 200 ms.
Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port) :-(

I use WSL2 on Win10 and Docker Desktop.

BTW, regular debug from browser is working as expected.

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
         backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="vendor/autoload.php"
         colors="true"
         forceCoversAnnotation="false"
         beStrictAboutCoversAnnotation="false"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="true"
         cacheResult="true"
         cacheResultFile="storage/app/.phpunit.result.cache"
         stopOnError="false"
         stopOnFailure="false">
    ...
</phpunit>
LazyOne
  • 158,824
  • 45
  • 388
  • 391

1 Answers1

3

EDIT: Updated the answer after seeing the phpunit.xml file content

The processIsolation="true" flag in the phpunit.xml file indicates that the tests run in parallel mode. Currently PHPStorm does not support debugging in parallel mode.

In order to use xdebug with phpunit, you should change processIsolation="false".