mirror of
https://github.com/flarum/core.git
synced 2025-07-30 21:20:24 +02:00
Tests: Use new authenticatedAs option where useful
There are two more API integration tests that explicitly add the "Authorization" header right now: - `Flarum\Tests\integration\api\authentication\WithApiKeyTest` - `Flarum\Tests\integration\api\csrf_protection\RequireCsrfTokenTest` These two specifically test authentication, so in those cases the explicitness seems desirable.
This commit is contained in:
@@ -24,9 +24,6 @@ class ListTest extends TestCase
|
||||
'users' => [
|
||||
$this->normalUser(),
|
||||
],
|
||||
'access_tokens' => [
|
||||
['token' => 'normaltoken', 'user_id' => 2],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -48,8 +45,9 @@ class ListTest extends TestCase
|
||||
public function shows_index_for_user()
|
||||
{
|
||||
$response = $this->send(
|
||||
$this->request('GET', '/api/notifications')
|
||||
->withHeader('Authorization', 'Token normaltoken')
|
||||
$this->request('GET', '/api/notifications', [
|
||||
'authenticatedAs' => 2,
|
||||
])
|
||||
);
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
|
Reference in New Issue
Block a user