title: Testing forms in symfony 2 phpunit
body: <p>I have a form with two fields. After submitting it, there's a redirection to the same controller that displayed that form.</p>
  
  <p>The method is as follows:</p>
  
  <pre><code>public function chartsAction($path, Request $request)
  {
     // display form
  
     if(isset($_POST))
     {
        // handle form submission
     }
  }
  </code></pre>
  
  <p>When it's not a POST request, the URL is <code>charts/</code>.</p>
  
  <p>When it's a POST request, the URL is for example <code>charts/dateFrom/2013-08/dateTo/2014-02</code>, so that's the $path argument of the method, and two variables depending on the form.</p>
  
  <hr>
  
  <p>Now I want to test this. The problem is that the form redirection gives me the same, charts/ website. It just doesn't add $path parameter to the route. What's going on? My test method:</p>
  
  <pre><code>   public function testChartsAction()
      {
          $crawler = $this-&gt;client-&gt;request('GET', '/charts', [], [], $this-&gt;credintials);
  
          $form = $crawler-&gt;selectButton('dateChooser[Choose]')-&gt;form([
              'dateChooser[dateFrom]' =&gt; '2014-08',
              'dateChooser[dateTo]'   =&gt; '2014-12',
          ]);
          $this-&gt;client-&gt;submit($form);
          $crawler = $this-&gt;client-&gt;followRedirect();
  
          $this-&gt;assertTrue($this-&gt;client-&gt;getResponse()-&gt;isRedirect('/charts/dateFrom/2014-08/dateTo/2014-12'));
          $this-&gt;assertTrue($this-&gt;client-&gt;getResponse()-&gt;isSuccessful());
      }
  </code></pre>
  
  <p>First assert gives me false.</p>