[英]VSCode - Php unit test?
Im making a test.php and trying to unit test this.我正在制作一个 test.php 并尝试对其进行单元测试。
Its my first time ever unit testing in VSCode in PHP.这是我第一次在 PHP 中的 VSCode 中进行单元测试。 My code looks like:
我的代码看起来像:
class TestCase extends PHPUnit\Framework\TestCase
{
public function test(){
$this->assertTrue(false);
}
public function test1(){
$this->assertTrue(true);
}
}
But when im hover the TestCase and press (F1) and choose (Better PHPUnit: Run), its saying "No task to run found. Configure Tasks..."但是当我将测试用例悬停并按(F1)并选择(Better PHPUnit:Run)时,它说“找不到要运行的任务。配置任务......”
Image 1:图 1:
Image 2:图 2:
If im supposed to add a Task.. Wich one should i choose and how do I navigate it to my test.php如果我应该添加一个任务..我应该选择哪个以及如何将其导航到我的 test.php
如果仍然想知道,请检查您的 vscode 用户设置键"task.autoDetect": "off"
并确保将其删除或将其设置为"task.autoDetect": "on"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.