【发布时间】:2016-04-06 23:38:51
【问题描述】:
我设置了一个简单的 PHPUnit/Symfony WebTestCase 来测试我们网站的登录表单。
$form = $crawler->filter("#register")->form();
// set form values
$crawler = $this->client->submit($form);
表单将提交到/register,然后在成功时重定向到/registered(如果失败,200/OK 返回到/register)。
如果我在上面的块之前使用$this->client->followRedirects();,或者在提交之后使用$this->client->followRedirect();,我会得到一个段错误。确实没有迹象表明段错误发生在哪里。
其他注意事项:如果我只运行此测试父类中的测试(2 个测试),即使用 --filter [THE CLASS],它运行良好。如果我尝试运行此测试以及整个套件(约 15 个测试),我会遇到段错误。
我尝试使用-d 标志为phpunit 提供更多内存,但这并没有真正的帮助。
【问题讨论】:
标签: php unit-testing symfony phpunit