-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 fix UserProfileSettingsResource.php (#1839)
- Loading branch information
1 parent
bd60349
commit 271433d
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace Tests\Feature\APIv1; | ||
|
||
use App\Models\User; | ||
use App\Providers\AuthServiceProvider; | ||
use Illuminate\Foundation\Testing\RefreshDatabase; | ||
use Tests\ApiTestCase; | ||
|
||
class SettingsTest extends ApiTestCase | ||
{ | ||
|
||
use RefreshDatabase; | ||
|
||
public function testGetProfileSettings(): void { | ||
$user = User::factory()->create(); | ||
$userToken = $user->createToken('token', array_keys(AuthServiceProvider::$scopes))->accessToken; | ||
|
||
$response = $this->get( | ||
uri: '/api/v1/settings/profile', | ||
headers: ['Authorization' => 'Bearer ' . $userToken] | ||
); | ||
$response->assertOk(); | ||
$response->assertJsonStructure([ | ||
'data' => [ | ||
'username', | ||
'displayName', | ||
'profilePicture', | ||
//... | ||
] | ||
]); | ||
} | ||
} |