[2020-06-11 17:45:32]请求。严重:未捕获的PHP异常LogicException:“会话启动后无法设置会话ID。”在/var/www/renault-del/del/src/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php第127行{“ exception”:“ [object](LogicException(code :0):会话开始后无法设置会话ID。在/var/www/renault-del/del/src/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php: 127)“} []
有关信息,这是我用来填写表格的脚本:class CmsBlockControllerTest extends WebTestCase
{
/** @var Client */
private $client;
protected function setUp()
{
parent::setUp();
$this->client = static::createClient();
}
public function testNewAction(): void
{
$crawler = $this->client->request(
'GET',
$this->generateRoute('delbackoffice_cms_block_new') // my own function to generate a route
);
$form = $crawler->selectButton('Enregistrer')
->form([
'block[title]' => 'title',
'block[identifier]' => 'identifier',
'block[content]' => 'content']);
$this->client->submit($form);
}
protected function tearDown()
{
parent::tearDown();
$this->client = null;
$this->tokenStorage = null;
$this->globalVariables = null;
}
}
在此先谢谢你
我想通过功能测试来测试表单。填写然后提交表单后,将显示以下错误消息:[2020-06-11 17:45:32] request.CRITICAL:未捕获的PHP异常...
通过在test.client.class上调用disableReboot