【问题标题】:How do you use PHPUnit with VSCode?你如何在 VSCode 中使用 PHPUnit?
【发布时间】:2019-11-17 13:30:48
【问题描述】:

我使用 Netbeans 进行了一些 PHPUnit 测试,但无法让最新版本 (PHPUnit 8) 工作。所以我想在VSCode中尝试一下。

关于让他们一起工作的任何建议或教程链接?

【问题讨论】:

  • 到目前为止你尝试过什么?你遇到错误了吗? google phpunit 和 vscode 时出现的一些选项你试过了吗?

标签: php visual-studio-code phpunit


【解决方案1】:

您需要在tasks.json 文件中定义一个自定义任务,该文件应位于.vscode 目录中。自定义任务可以是这样的:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run tests",
            "type": "shell",
            "command": "phpunit",
            "args": ["--stop-on-error"],
            "group": "test",
            "presentation": {
                "reveal": "always",
                "panel": "new"
            }
        }
    ]
}

在文档中了解更多信息:https://code.visualstudio.com/docs/editor/tasks#_custom-tasks

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-16
    • 2020-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-02
    相关资源
    最近更新 更多