protected function getForm($buttonText = null)
{
try {
if ($buttonText) {
return $this->crawler->selectButton($buttonText)->form();
}
return $this->crawler->filter('form')->form();
} catch (InvalidArgumentException $e) {
throw new InvalidArgumentException("Could not find a form that has submit button [{$buttonText}].");
}
}