29 lines
612 B
PHP
29 lines
612 B
PHP
<?php
|
|
|
|
namespace Tests\Feature\Auth;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Illuminate\Foundation\Testing\WithFaker;
|
|
use Tests\TestCase;
|
|
use App\Models\User;
|
|
use Hash;
|
|
use Laravel\Sanctum\Sanctum;
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
class CurrentTest extends TestCase
|
|
{
|
|
use DatabaseTransactions;
|
|
/**
|
|
* A basic feature test example.
|
|
*/
|
|
public function test_success(): void
|
|
{
|
|
$user = User::factory()->create();
|
|
Sanctum::actingAs($user);
|
|
|
|
$response = $this->get('/auth/current');
|
|
|
|
$response->assertStatus(200);
|
|
}
|
|
}
|