sajad torkamani

Suppose you wrote this PHPUnit test for a Symfony HTTP endpoint:

public function testMeEndpoint() { 
    $response = $this->client->request('GET', '/v1/users/me', [
      'auth_bearer' => 'some-token',
    ]);
}

And that resulted in a AccessDeniedException and this failed test:

To find out what caused the AccessDeniedException, you can do this:

Find out cause of 403 error in Symfony PHPUnit test