【发布时间】:2020-07-10 02:56:23
【问题描述】:
在 Symfony 5 中运行 WebTestCase 之前如何加载固定装置?
您使用哪些方法而不安装任何额外的捆绑包?
class MyPageControllerTest extends WebTestCase
{
public function testIndexAction()
{
$client = static::createClient();
$crawler = $client->request('GET', '/');
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$table = $crawler->filter('.table-emp');
$this->assertCount(1, $table->filter('tbody tr'));
}
}
【问题讨论】:
标签: fixtures testcase symfony5