I have a form, without action (is submitted with javascript) and I'm trying to write a unit test for it, but it fails because "action" attribute is missing:
InvalidArgumentException : Current URI must be an absolute URL ("").
There is a way to do add it in unit tests or modify the html content using the crawler?
<form id="form_search_page">
<input type="text" name="keyword" value="" />
<button type="submit" name="searchBtn" id="searchBtn">Search</button>
</form>
$client = $this->makeClient(true);
$url = $this->createRoute("page_index"));
$crawler = $client->request('GET', $url);
$response = $client->getResponse();
$form = $crawler->filter('#form_search_page')->form();
$params = array(
"form[text]" => "dummy title"
);
$form->setValues($params);
$crawler = $client->submit($form);
$response = $client->getResponse();
$this->assertGreaterThan(0, $crawler->filter('.pages li')->count());