How can I add the authorization header in phpunit? I am testing a json api that requires an api_token. laravel docs provide a actingAs method. But this does not work in my case because the api token is not directly related to the users table.
EDIT:
public function test_returns_response_with_valid_request()
{
$response = $this->json('post', '/api/lookup', [
'email' => '[email protected]'
]);
$response->assertStatus(200);
$response->assertJsonStructure([
'info' => [
'name'
]
]);
}