关于模拟表单上传写单元测试

浏览:521 发布日期:2018/05/25 分类:ThinkPHP5专区
https://www.kancloud.cn/code7/tpunit/378492
按这个手册的例子用方法submitForm,执行后报InvalidArgumentException: Could not find a form that has submit button [submit].
断点后是在\vendor\symfony\dom-crawler\Crawler.php
public function form(array $values = null, $method = null)
{
if (!count($this)) {
throw new \InvalidArgumentException('The current node list is empty.');
}
这里终止了,打印$this确实有值,不知为什么count($this)会为0


单元测试的代码为$this->visit('crm/member/form')->submitForm('submit', ['test' => 'test'])->see('hello');
最佳答案
评论() 相关
后面还有条评论,点击查看>>