【问题标题】:How to debug tests within Symfony 4 and Simple-PHPUnit?如何在 Symfony 4 和 Simple-PHPUnit 中调试测试?
【发布时间】:2018-09-18 07:22:14
【问题描述】:

在早期版本中,可以在 PHPStorm 提供的功能内调试任何单元测试。我应该如何使用vendor/bin/simple-phpunit 对特定测试运行调试会话?

【问题讨论】:

  • 我以同样的方式(本地)运行它,只是将Setings -> Languages & frameworks -> PHP -> Test frameworks 中的“phpunit.phar 路径”更改为 simple-phpunit
  • @NikitaU。 — 但是 PHPstorm 尖叫着找不到 phpunit。但是,我注意到 phpunit 已安装在 vendor 内的隐藏 (.phpunit) 目录中。
  • 不幸的是,simple-phpunit 启动了另一个子进程,所以调试很奇怪。仍在努力。

标签: php symfony phpunit


【解决方案1】:

现在有点隐蔽。

  1. 运行vendor/bin/simple-phpunit 以获取一些不那么可见的依赖项,
  2. 使用以下路径在 PHPStorm 中设置新的测试框架:/vendor/bin/.phpunit/phpunit-5.7/phpunit 并选中 path to composer.phar。请记住不要忘记将 phpunit.xml 指定为默认配置以提供自动加载器,
  3. 现在一切正常。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-04-26
    • 2019-11-22
    • 2020-08-09
    • 2015-01-31
    • 1970-01-01
    • 2015-01-14
    • 1970-01-01
    • 2019-12-29
    相关资源
    最近更新 更多