I get an "InvalidArgumentException: The current node list is empty." error with my functional tests on Symfony2.
According to different posts I have wrote the following code:
In the Test Class:
$client = static::createClient();
$crawler = $client->request('GET', 'http://localhost/site/web/app_dev.php/en/offer');
$buttonCrawlerNode = $crawler->selectButton('SUBMIT');
$form = $buttonCrawlerNode->form();
$form['travelComment'] = 'Hey there!';
In the twig:
<form method="post" {{ form_enctype(form) }}>
{{ form_widget(form) }}
<input value="SUBMIT" type="submit" class="btn btn-primary" />
</form>
As you can see the input value SUBMIT is the same in the selectbutton function.
Then I get the following message:
InvalidArgumentException: The current node list is empty.