【问题标题】:AsserEquals not found in WebTestCase Symfony在 WebTestCase Symfony 中找不到 AsserEquals
【发布时间】:2017-06-01 10:29:37
【问题描述】:

我有一个 WebTestCase 类:

use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Bundle\FrameworkBundle\Client;

class ApiAdminInvoiceControllerTest extends WebTestCase
{
    public function test()
    {
        ...
        $this->assertArrayHasKey('id', $array);
        ...
    }
}

我在所有断言中都有这个错误:Method 'assertArrayHasKey' not found

【问题讨论】:

    标签: php symfony unit-testing web-testing


    【解决方案1】:

    尝试使用 PHPUnit\Framework\TestCase;作为基类

    【讨论】:

    猜你喜欢
    • 2019-04-17
    • 2014-07-16
    • 2017-03-24
    • 2020-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-08
    • 2018-06-11
    相关资源
    最近更新 更多