vendredi 30 décembre 2016

Header getting dropped in Laravel/PHPUnit Testing

I have a laravel 5.x app and the unit testing was working all fine. Now the php unit has stopped sending headers with http request. One of my unit tests have the following code

 $content='';

    $content = $this->post('users/login', ['password' => 'mypass',
            'email' => 'james.bond@gmail.com'])->response->getContent();

   $data = json_decode($content);
   $token = $data->token;


  $content = $this->put('users/xsettings/0', ['HTTP_Authorization' => $token])->response->getContent();

I have checked the existence for Authorization at the receiving end and found that it is not in the request.

I have tried calling $this->refreshApplication() and tried using $this->call() without luck.

Any help is appreciated.

Thanks in advance



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire