【问题标题】:Strange behaviour of PHPUnit + Xdebug + PhpStormPHPUnit + Xdebug + PhpStorm 的奇怪行为
【发布时间】:2016-12-14 08:54:50
【问题描述】:

我在 Debian 的 shell 中使用 PhpStorm + Xdebug + PHPUnit。 工作正常,但有一个奇怪的行为,主要是无聊。

当我在 shell 中运行 phpunit 命令时,PhpStorm 向我显示的第一个中断是在检查 php 版本的行中的 /usr/local/bin/phpunit...

但显然我没有在该文件中放置任何断点。

if (version_compare('5.6.0', PHP_VERSION, '>')) {
fwrite(
    STDERR,
    'This version of PHPUnit requires PHP 5.6; using the latest version of PHP is highly recommended.' . PHP_EOL
);

die(1);
}

此外,该文件非常大,因此在您继续之前它会被阻塞几秒钟。

有什么建议吗?

【问题讨论】:

  • 取消选中Run | Break at first line in PHP scripts。但很可能它无济于事——然后你必须检查Setting/Preferences | Languages & Frameworks | PHP | Debug 中的设置——查看Force break at the first line... 选项——很可能第二个正在这样做。
  • @LazyOne 谢谢。我没有选中“当脚本在项目之外时在第一行强制中断”,现在可以正常工作了。
  • 感谢大家的帮助,成功了!真是个烦人的选择。

标签: php shell phpunit phpstorm xdebug


【解决方案1】:

确保 Run | Break at first line in PHP scripts 未选中。

但很可能在这里无济于事。如果是这样:

  1. Setting/Preferences | Languages & Frameworks | PHP | Debug
  2. 取消选中 Force break at the first line when a script is outside the project 选项 -- 根据您的描述,此行为应由此人负责。

【讨论】:

    猜你喜欢
    • 2012-08-03
    • 1970-01-01
    • 2017-08-28
    • 2014-02-10
    • 1970-01-01
    • 2013-10-29
    • 1970-01-01
    • 2012-04-06
    • 2013-11-03
    相关资源
    最近更新 更多