Symfony2 functional testing InvalidArgumentException: The current node list is empty

前端 未结 7 744
伪装坚强ぢ
伪装坚强ぢ 2020-12-18 23:41

I get \"InvalidArgumentException: The current node list is empty.\" running functional tests through PHPUnit. Here is test i wrote:

public function testAdd()         


        
7条回答
  •  别那么骄傲
    2020-12-19 00:31

    You can debug the problem by using var_dump($client->getResponse()->getContent());

    Additionally, I think you should write this:

    $crawler = $client->submit($form);
    

    Otherwise you'll be testing the response of the first url, before form submission.

提交回复
热议问题