Skip to content

Commit fcc0c35

Browse files
committed
API Test Case
1 parent 1c8fb63 commit fcc0c35

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/Feature/Api/V1/LoginTest.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
namespace Tests\Feature\Api\V1;
4+
5+
use Tests\TestCase;
6+
use App\Models\Access\User\User;
7+
use Illuminate\Support\Facades\Auth;
8+
use Illuminate\Support\Facades\Event;
9+
use App\Events\Frontend\Auth\UserLoggedIn;
10+
11+
class AuthTest extends TestCase
12+
{
13+
/** @test */
14+
public function users_can_login_through_api()
15+
{
16+
$res = $this->json('POST', '/api/v1/auth/login', [
17+
'email' => $this->user->email,
18+
'password' => '1234'
19+
])
20+
->assertStatus(200)
21+
->assertJsonStructure([
22+
'message',
23+
'token'
24+
]);
25+
}
26+
}

0 commit comments

Comments
 (0)