Php 在WebTestCase Symfony中未找到AsserCals
我有一个WebTestCase类:Php 在WebTestCase Symfony中未找到AsserCals,php,symfony,unit-testing,web-testing,Php,Symfony,Unit Testing,Web Testing,我有一个WebTestCase类: use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Client; class ApiAdminInvoiceControllerTest extends WebTestCase { public function test() { ... $this->assertArrayHas
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Bundle\FrameworkBundle\Client;
class ApiAdminInvoiceControllerTest extends WebTestCase
{
public function test()
{
...
$this->assertArrayHasKey('id', $array);
...
}
}
我在所有断言中都有此错误:
未找到方法“assertArrayHasKey”
尝试使用PHPUnit\Framework\TestCase;作为基类尝试使用PHPUnit\Framework\TestCase;作为基类但是扩展了PHPUnit\Framework\TestCase
,那么为什么要更改基类呢?好的。对不起,我没注意到。您的phpunit版本是什么?但是扩展了phpunit\Framework\TestCase
,那么为什么要更改基类呢?好的。对不起,我没注意到。你的phpunit版本是什么?