[英]phpunit 8 and PHPUnit_Framework_TestCase
I wrote the following test:我写了以下测试:
use PHPUnit\Framework\TestCase;
//other uses
class StatusCheckerTest extends TestCase
{
public function testEntryValidation() {
//some code
$this->assertFalse($validation_result);
}
}
I tried to run it with phpunit StatusCheckerTest.php
But when I do it, I see error:我尝试使用
phpunit StatusCheckerTest.php
运行它但是当我这样做时,我看到错误:
PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found in
/var/www/html/nextcloud/apps/globalstatus/tests/OCA/GlobalStatus/Tests/StatusCheckerTest.php on line 12
I used PHPUnit 8.4.3 (also tried with 6.5.5).我使用了 PHPUnit 8.4.3(也尝试使用 6.5.5)。 I installed it manually.
我手动安装了它。
phpunit --version
PHPUnit 8.4.3 by Sebastian Bergmann and contributors.
Why does it look for PHPUnit_Framework_TestCase
?为什么要寻找
PHPUnit_Framework_TestCase
? It must be deprecated.它必须被弃用。
If you want to run only a specific test class, you need to pass it with a filter
option:如果你只想运行一个特定的测试 class,你需要通过一个
filter
选项:
phpunit --filter StatusCheckerTest
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.