I am using symfony 3.0 and phpunit 3.7.1.I want to submit a form via phpunit file. File Name: abcControllerTest.php
<?php
namespace AbcBundle\Tests\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\HttpFoundation\Request;
class AbcControllerTest extends WebTestCase {
public function testEmpty() {
$whereParams = array('params' => array(
'var' => '',
));
return $whereParams;
}
/**
* ABC Builder
* @depends testEmpty
*/
public function testAbc(array $whereParams) {
$client = static::createClient();
$crawler = $client->request('GET', $GLOBALS['host'] . '/abc/ac_file/param', $whereParams);
$buttonCrawlerNode = $crawler->selectButton('Submit');
$form = $buttonCrawlerNode->form();
$crawler = $client->submit($form);
}
}
I am testing export report functionality thats why i am just creating a submit button and trying to submit form on specific url with some parameter. Error Message: InvalidArgumentException: The current node list is empty.
Anyone can suggest me what can i do?