title: Access by browser works ok ,while PHPUnit fails
body: <p>I am using symfony2.8 ,FOSUserBundle and PHPUnit 5.7</p>
  
  <p>I can access /login by browser.</p>
  
  <p>However PHPUnit fail.</p>
  
  <p>So I just dump the $client->getResponse() of PHPUnit </p>
  
  <pre><code>$client = static::createClient();
  
  $crawlerLogin = $client-&gt;request('GET', '/login');
  print $client-&gt;getResponse()-&gt;getContent();
  </code></pre>
  
  <p>These are the header of error code.
  Do you think why this happen ???</p>
  
  <pre><code>Failed asserting that '&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8" /&gt;
          &lt;meta name="robots" content="noindex,nofollow" /&gt;
          &lt;title&gt;    Failed to start the session because headers have already been sent by &amp;quot;phar:///usr/local/bin/phpunit/phpunit/Util/Printer.php&amp;quot; at line 110. (500 Internal Server Error)
  &lt;/title&gt;
  </code></pre>
  
  <p>This is my phpunit.xml</p>
  
  <p>/app/phpunit.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html --&gt;
  &lt;phpunit
      backupGlobals               = "false"
      backupStaticAttributes      = "false"
      colors                      = "true"
      convertErrorsToExceptions   = "true"
      convertNoticesToExceptions  = "true"
      convertWarningsToExceptions = "true"
      processIsolation            = "false"
      stopOnFailure               = "false"
      syntaxCheck                 = "false"
      bootstrap                   = "bootstrap.php.cache" &gt;
  
      &lt;testsuites&gt;
          &lt;testsuite name="Project Test Suite"&gt;
              &lt;directory&gt;../src/*/*Bundle/Tests&lt;/directory&gt;
              &lt;directory&gt;../src/*/Bundle/*Bundle/Tests&lt;/directory&gt;
          &lt;/testsuite&gt;
      &lt;/testsuites&gt;
  
      &lt;!--
      &lt;php&gt;
          &lt;server name="KERNEL_DIR" value="/path/to/your/app/" /&gt;
      &lt;/php&gt;
      --&gt;
  
      &lt;filter&gt;
          &lt;whitelist&gt;
              &lt;directory&gt;../src&lt;/directory&gt;
              &lt;exclude&gt;
                  &lt;directory&gt;../src/*/*Bundle/Resources&lt;/directory&gt;
                  &lt;directory&gt;../src/*/*Bundle/Tests&lt;/directory&gt;
                  &lt;directory&gt;../src/*/Bundle/*Bundle/Resources&lt;/directory&gt;
                  &lt;directory&gt;../src/*/Bundle/*Bundle/Tests&lt;/directory&gt;
              &lt;/exclude&gt;
          &lt;/whitelist&gt;
      &lt;/filter&gt;
  
  &lt;/phpunit&gt;
  </code></pre>