Skip to content

HTTP headers not working for unit tests #1655

@schickling

Description

@schickling

If you try to get a HTTP header via Request::header('HTTP_USER_AGENT') when the request was made through a test case, it always returns "NULL". If the request was made through the browser everything works fine.

I checked in the symfony source code wether the headers were set (when running the test).

var_dump($server):

array(4) {
  'HTTP_HOST' =>
  string(9) "localhost"
  'HTTP_USER_AGENT' =>
  string(19) "Symfony2 BrowserKit"
  'HTTPS' =>
  bool(false)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions