Проблемы настройки удаленной отладки PhpStorm для тестов PHPUnit - PullRequest
0 голосов
/ 08 февраля 2020

Я пытаюсь настроить Xdebug для отладки моего Laravel приложения, работающего на Homestead. У меня это работает для http запросов от браузеров. Но я не могу заставить его работать для тестов PHPUnit.

Вот моя конфигурация:

Config

Interpreter

XDebug

Homestead xdebug config

All I get is this!

xdebug Журнал при запуске модульных тестов с отладчиком

[2215] Log opened at 2020-02-08 21:34:36
[2215] I: Checking remote connect back address.
[2215] I: Checking header 'HTTP_X_FORWARDED_FOR'.
[2215] I: Checking header 'REMOTE_ADDR'.
[2215] W: Remote address not found, connecting to configured address/port: 10.0.2.2:9000. :-|
[2215] I: Connected to client. :-)
[2215] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///home/vagrant/code/vendor/phpunit/phpunit/phpunit" language="PHP" xdebug:language_version="7.4.1" protocol_version="1.0" appid="2215" idekey="19707"><engine version="2.9.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2020 by Derick Rethans]]></copyright></init>

[2215] <- eval -i 1 -- KHN0cmluZykoaW5pX2dldCgneGRlYnVnLmNvdmVyYWdlX2VuYWJsZScpLic7Jy5pbmlfZ2V0KCd4ZGVidWcucHJvZmlsZXJfZW5hYmxlJykuJzsnLmluaV9nZXQoJ3hkZWJ1Zy5yZW1vdGVfYXV0b3N0YXJ0JykuJzsnLmluaV9nZXQoJ3hkZWJ1Zy5yZW1vdGVfY29ubmVjdF9iYWNrJykuJzsnLmluaV9nZXQoJ3hkZWJ1Zy5yZW1vdGVfbW9kZScpKQ==
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="eval" transaction_id="1"><property type="string" size="11" encoding="base64"><![CDATA[MTswOzE7MTtyZXE=]]></property></response>

[2215] <- feature_set -i 2 -n show_hidden -v 1
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="2" feature="show_hidden" success="1"></response>

[2215] <- feature_set -i 3 -n max_depth -v 1
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="3" feature="max_depth" success="1"></response>

[2215] <- feature_set -i 4 -n max_children -v 100
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="4" feature="max_children" success="1"></response>

[2215] <- feature_set -i 5 -n extended_properties -v 1
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="5" feature="extended_properties" success="1"></response>

[2215] <- feature_set -i 6 -n resolved_breakpoints -v 1
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="6" feature="resolved_breakpoints" success="1"></response>

[2215] <- status -i 7
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="status" transaction_id="7" status="starting" reason="ok"></response>

[2215] <- step_into -i 8
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="step_into" transaction_id="8" status="break" reason="ok"><xdebug:message filename="file:///home/vagrant/code/vendor/phpunit/phpunit/phpunit" lineno="12"></xdebug:message></response>

[2215] <- breakpoint_set -i 9 -t line -f file:///home/vagrant/code/app/app/Http/Controllers/Api/AuthController.php -n 19
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="9" id="22150001" resolved="unresolved"></response>

[2215] <- breakpoint_set -i 10 -t line -f file:///home/vagrant/code/app/app/Http/Controllers/Api/AuthController.php -n 22
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="10" id="22150002" resolved="unresolved"></response>

[2215] <- breakpoint_set -i 11 -t line -f file:///home/vagrant/code/app/app/Http/Controllers/Api/AuthController.php -n 14
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="11" id="22150003" resolved="unresolved"></response>

[2215] <- breakpoint_set -i 12 -t line -f file:///home/vagrant/code/app/tests/Unit/ApiAuthTest.php -n 17
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="12" id="22150004" resolved="unresolved"></response>

[2215] <- stack_get -i 13
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="13"><stack where="{main}" level="0" type="file" filename="file:///home/vagrant/code/vendor/phpunit/phpunit/phpunit" lineno="12"></stack></response>

[2215] <- run -i 14
[2215] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" command="run" transaction_id="14" status="stopping" reason="ok"></response>

[2215] <- run -i 15
[2215] Log closed at 2020-02-08 21:34:41
...