VSCode 推出了新版 Testing API,加上 2.0 版當初設計時沒有考慮 Docker 和 SSH 的使用情境,所以我把 PHPUnit For VSCode 整個重寫了。
3.0 版的改進
VSCode Testing API 整合:測試列表直接顯示在 VSCode 側邊欄,錯誤訊息也能直接在編輯器內呈現。
PHPUnit Output 美化:改用 parse TeamCity protocol,每完成一個 TestCase 就即時回報結果,不像 2.0 版要等全部跑完才知道。
Docker Support:
1
2
3
4
5
6
7
8
9
10
11
12
| {
"phpunit.command": "docker run --rm -t -v ${pwd}:/app -w /app php:latest php",
"phpunit.php": "php",
"phpunit.phpunit": "vendor/bin/phpunit",
"phpunit.args": [
"-c",
"phpunit.xml"
],
"phpunit.paths": {
"${workspaceFolder}": "/app"
}
}
|
SSH Support:
1
2
3
4
5
6
7
8
9
10
11
12
| {
"phpunit.command": "ssh -i dockerfiles/sshd/id_rsa -p 2222 root@localhost -o StrictHostKeyChecking=no",
"phpunit.php": "php",
"phpunit.phpunit": "/app/vendor/bin/phpunit",
"phpunit.args": [
"-c",
"/app/phpunit.xml"
],
"phpunit.paths": {
"${workspaceFolder}": "/app"
}
}
|
有問題歡迎到 GitHub 上提 issue。