I get an "InvalidArgumentException: The current node list is empty." error with my functionnal 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.
Please, does anybody have an idea ?
Thanks !!!
form[travelComment]
? – A.L Mar 12 at 17:42name="SUBMIT"
– Matteo Mar 12 at 18:49<input name="SUBMIT" value="SUBMIT" type="submit" class="btn btn-primary">
. I will look for an unclosed tag. – Grogro2000 2 days ago