检查 symfony panther 测试客户端上的状态代码或错误

问题描述

我用 panther 执行了一个测试,我想检查是否有异常或状态代码是什么。通常我会启用一个配置文件并检查是否有异常事件。我怎么能用黑豹客户端做到这一点?

基本上对于每个 url 我想运行一个基本测试:

$client = static::createPantherClient();
$crawler = $client->enableProfile();
$crawler = $client->request('GET',(string) $url);

// right Now i use this to gues that the request is successful but i'd like to check the status code or log
$this->assertSelectorNotExists('.exception-summary');

$profile = $client->getProfile();
$exceptionProfile = $profile->getCollector('exception');

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)