Laravel\Lumen\Testing\CrawlerTrait::getForm PHP Method

getForm() protected method

Get the form from the page with the given submit button text.
protected getForm ( string | null $buttonText = null ) : Form
$buttonText string | null
return Symfony\Component\DomCrawler\Form
    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}].");
        }
    }