yasd icon indicating copy to clipboard operation
yasd copied to clipboard

PHPstorm下单元测试如何进行debug

Open yimuczhou opened this issue 4 years ago • 6 comments

我通过phpunit去进行调试代码,可以使用吗?我看介绍都是远程接口调用?

yimuczhou avatar Aug 05 '21 09:08 yimuczhou

应该是可以的,为了和xdebug的行为保持一致,你可以配置:

yasd.open_extended_info=1

这样的话,相当于默认开启了php -e选项.

huanghantao avatar Aug 05 '21 10:08 huanghantao

image

@huanghantao 不太行, `Yasd => enabled Author => codinghuang [email protected] Version => 0.3.9-alpha Built => Aug 5 2021 17:00:00

Directive => Local Value => Master Value yasd.breakpoints_file => no value => no value yasd.debug_mode => remote => remote yasd.remote_host => 127.0.0.1 => 127.0.0.1 yasd.remote_port => 9000 => 9000 yasd.depth => 1 => 1 yasd.log_level => -1 => -1 yasd.max_executed_opline_num => 0 => 0 yasd.init_file => no value => no value yasd.open_extended_info => 1 => 1 xdebug.coverage_enable => 1 => 1 xdebug.profiler_enable => 1 => 1 xdebug.remote_autostart => 1 => 1 xdebug.remote_connect_back => 0 => 0 xdebug.remote_mode => req => req xdebug.idekey => hantaohuang => hantaohuang`

yimuczhou avatar Aug 05 '21 12:08 yimuczhou

你要配置interpreter options才行,否则,默认会走xdebug的配置.

image

image

huanghantao avatar Aug 06 '21 01:08 huanghantao

@huanghantao 需要配置哪些参数, 贴出来呗

yimuczhou avatar Aug 06 '21 07:08 yimuczhou

@huanghantao 我在hyperf框架下PHPunit. 还是不行。大佬求赐教 interpreter options image image image

yimuczhou avatar Aug 12 '21 11:08 yimuczhou

加我微信codinghuang

---原始邮件--- 发件人: @.> 发送时间: 2021年8月12日(周四) 晚上7:07 收件人: @.>; 抄送: @.@.>; 主题: Re: [swoole/yasd] PHPstorm下单元测试如何进行debug (#142)

@huanghantao 我在hyperf框架下PHPunit. 还是不行。大佬求赐教 interpreter options

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

huanghantao avatar Aug 12 '21 11:08 huanghantao

可以考虑使用 swoole-src的 xdebug分支,https://github.com/swoole/swoole-src/tree/support-xdebug 可以直接使用xdebug进行调试,前提是PHP版本要大于等于8.1

huanghantao avatar Nov 26 '22 05:11 huanghantao