move into sonardesk
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Modules\Api\Models\ApiToken;
|
||||
use Modules\Api\Providers\ApiServiceProvider;
|
||||
|
||||
it('boots the api module', fn () => expect(app()->providerIsLoaded(ApiServiceProvider::class))->toBeTrue());
|
||||
it('hashes issued api tokens', function (): void {
|
||||
$u = User::factory()->create();
|
||||
[$t,$plain] = ApiToken::issue($u, 'Test', ['content.read']);
|
||||
expect($t->getRawOriginal('token'))->toBe(hash('sha256', $plain))->not->toBe($plain);
|
||||
});
|
||||
it('publishes openapi documentation', fn () => $this->getJson('/api/v1/openapi.json')->assertOk()->assertJsonPath('openapi', '3.1.0'));
|
||||
Reference in New Issue
Block a user