我写了以下测试:
use PHPUnit\Framework\TestCase;
//other uses
class StatusCheckerTest extends TestCase
{
public function testEntryValidation() {
//some code
$this->assertFalse($validation_result);
}
}我试图用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我使用的是PHPUnit 8.4.3 (也尝试了6.5.5)。我手动安装的。
phpunit --version
PHPUnit 8.4.3 by Sebastian Bergmann and contributors.为什么它要查找PHPUnit_Framework_TestCase?它必须被弃用。
发布于 2019-11-23 00:26:10
如果您只想运行特定的测试类,则需要使用filter选项传递它:
phpunit --filter StatusCheckerTesthttps://stackoverflow.com/questions/58996152
复制相似问题