title: Symfony2 functional test prints out redirect html and stops test execution
body: <p>I'm struggling to understand what is wrong with my functional testing or project settings: the phpunit execution just prints out the following information (I'm not printing this out in the test suite - i.e. it doesn't come from the client->getResponse() printing or anything). Additionally the whole test execution stops immediately without any result information after this text is printed out to the command line:</p>
  
  <p></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
          &lt;meta http-equiv="refresh" content="1;url=/" /&gt;
  
          &lt;title&gt;Redirecting to /&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          Redirecting to &lt;a href="/"&gt;/&lt;/a&gt;.
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>After running phpunit from command line:</p>
  
  <pre><code>phpunit -c app --group temp1 src/AppBundle/Tests/Controller/SecurityControllerTest.php
  </code></pre>
  
  <p>My test code is rather simple: </p>
  
  <pre><code>class SecurityControllerTest extends WebTestCase
  {
     /**
      * test login with succesfull case
      *
      * @group login
      * @group temp1
      */
      public function testLogin_success()
      {
          $client  = static::createClient();
          $crawler = $client-&gt;request('GET', '/'); 
  
          // temp - just to test that the initial crawler location is correct
          $this-&gt;assertGreaterThan(0, $crawler-&gt;filter('html:contains("System Login")')-&gt;count(), "login page not found");
  
          $client-&gt;followRedirects(true);
  
          $crawler = $this-&gt;loginSubmit($client, $crawler, "basic_user1@email.com", "basic_user1_password");
          // THE BELOW ROWS ARE NEVER REACHED
  
          // test that the user can access the user home
          $crawler = $client-&gt;request('GET', '/user/myprofile');
          $this-&gt;assertGreaterThan(0, $crawler-&gt;filter('html:contains("Welcome to your user profile")')-&gt;count(), "User homepage not accessible after login");
      }
  
      private function loginSubmit($client, $crawler, $username, $password)
      {        
          $loginButton = $crawler-&gt;selectButton('Login');
          $loginForm   = $loginButton-&gt;form();
          $loginForm['form[email]']    = $username;
          $loginForm['form[password]'] = $password;
  
          // BELOW IS THE ROW THAT RESULTS IN THE PRINTOUT + TEST EXECUTION STOP
          return $client-&gt;submit($loginForm);
      }
  
      //....
  }
  </code></pre>
  
  <p>Additionally the exactly same test case is working fine on another project that I'm working on so I've been trying to dig out the differences in the project configurations etc without luck.</p>
  
  <p>Any help is greatly appreciated - feel free to ask for some other code / configuration file contents if that might be helpful/relevant.</p>
  
  <p>using symfony 2.3.12 &amp; phpunit 4.1.0</p>
  
  <p><strong>UPDATED: specific code chain that leads to the error</strong></p>
  
  <p>So after managing to work around this problem by solving the underlying project session issues couple of days ago, I returned to debug this issue still a bit further. And currently it seems that the result is due to the following code chain, first calling forward:</p>
  
  <pre><code>$this-&gt;forward('bundle:controller:action')-&gt;send();
  </code></pre>
  
  <p>and in the forwarded controller action calling redirect:</p>
  
  <pre><code>$this-&gt;redirect($this-&gt;generateUrl($route, $parameters))-&gt;send();
  </code></pre>
  
  <p>obviously this controller flow seems a bit strange in general, but the question still remains why this leads into the observed result?</p>