Hi,
I'm trying to login to an API before execute some behat tests with this function. It seems not to accept the header.
/**
* @BeforeScenario @login
*
*/
public function login(BeforeScenarioScope $scope)
{
$user = $this->doctrine->getManager()->getRepository('App:User')->findOneByEmail('test@test.com');
$token = $this->jwtManager->create($user);
$this->restContext = $scope->getEnvironment()->getContext(RestContext::class);
$this->restContext->iAddHeaderEqualTo('Authorization', "Bearer $token");
$this->restContext->printLastResponseHeaders();
}
The last line return following output, where authorization header is missing
content-type: application/ld+json; charset=utf-8
x-content-type-options: nosniff
x-frame-options: deny
cache-control: no-cache, private
date: Tue, 23 Oct 2018 15:58:14 GMT
link: <https://localhost/api/docs.jsonld>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
Hi,
I'm trying to login to an API before execute some behat tests with this function. It seems not to accept the header.
The last line return following output, where authorization header is missing