common\WebTestCase::submitForm PHP Method

submitForm() protected method

Submits the form and mimics the GET parameters, since they aren't added by default in the functional tests
protected submitForm ( Client $client, Form $form, array $data = [] )
$client Symfony\Bundle\FrameworkBundle\Client
$form Symfony\Component\DomCrawler\Form
$data array
    protected function submitForm(Client $client, Form $form, array $data = array())
    {
        // Get parameters should be set manually. Symfony uses the request object,
        // but spoon still checks the $_GET and $_POST parameters
        foreach ($data as $key => $value) {
            $_GET[$key] = $value;
            $_POST[$key] = $value;
        }
        $client->submit($form);
        foreach ($data as $key => $value) {
            unset($_GET[$key]);
            unset($_POST[$key]);
        }
    }