Symfony test fonctionnel - en-têtes personnalisés ne passe pas par

Pour quelque raison que quand j'ai envoyé une nouvelle $client->demande les en-têtes que j'spécifier perdu:

public function testGetClientsAction()
{
    $client = static::createClient();

    $cookie = new Cookie('locale2', 'en', time() + 3600 * 24 * 7, '/', null, false, false);
    $client->getCookieJar()->set($cookie);

    //Visit user login page and login
    $crawler = $client->request('GET', '/login');
    $form = $crawler->selectButton('login')->form();
    $crawler = $client->submit($form, array('_username' => 'greg', '_password' => 'greg'));

    $client->request(
       'GET', 
       '/clients', 
        array(), 
        array(), 
        array('X-Requested-With' => 'XMLHttpRequest', 'accept' => 'application/json')
    );

    print_r($client->getResponse());
    die();

}

Dans la méthode qui est testé, j'ai cela sur la première ligne:

print_r($request->headers->all());

La réponse est comme suit:

Array
(
    [host] => Array
        (
            [0] => localhost
        )

    [user-agent] => Array
        (
            [0] => Symfony2 BrowserKit
        )

    [accept] => Array
        (
            [0] => text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
        )

    [accept-language] => Array
        (
            [0] => en-us,en;q=0.5
        )

    [accept-charset] => Array
        (
            [0] => ISO-8859-1,utf-8;q=0.7,*;q=0.7
        )

    [referer] => Array
        (
            [0] => http://localhost/login_check
        )

    [x-php-ob-level] => Array
        (
            [0] => 1
        )

)
InformationsquelleAutor greg | 2012-07-18