S
S
Steve2021-05-10 10:32:28
JSON Web Token
Steve, 2021-05-10 10:32:28

How to use JWT in Unittest?

How to send header with token in unit tests?
I send like this:

$client->request('GET', $router->generate('article_list'), [], [], ['HTTP_Authorization' => self::getJwt()]);

Gives error 500

First, an unauthorized user is checked (everything is in order), and later in the same test, the check is already with a token..

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question