比方说,我有一个表格:
<form action="test.php" method="post">
<input type="text" name="myinput" value="3" />
<button>Submit</button>
</form>
这是我使用 Crawler 进行的过滤和测试:
$client = static::createClient();
$crawler = $client->request('GET', 'test.php');
$filter = 'button';
$buttonNode = $crawler->selectButton($crawler->filter($filter));
$this->assertEquals(1, $buttonNode->count()); // this works
$form = $buttonNode->form(); // This shows error "LogicException: Unable to submit on a "input" tag."
$client->submit($form);