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>

1 Answer 1

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".

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

1 Comment

You may check it from the question details

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.