1 | <?php |
||
2 | |||
3 | namespace Tests\Unit; |
||
4 | |||
5 | use App\Models\User; |
||
6 | use Illuminate\Foundation\Testing\RefreshDatabase; |
||
7 | use Tests\TestCase; |
||
8 | |||
9 | class AuthenticationTest extends TestCase |
||
10 | { |
||
11 | use RefreshDatabase; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
12 | |||
13 | /** |
||
14 | * User Login Test. |
||
15 | * |
||
16 | * @return void |
||
17 | */ |
||
18 | public function test_login() |
||
19 | { |
||
20 | $user = User::factory()->create([ |
||
21 | 'email' => '[email protected]', |
||
22 | 'password' => bcrypt('123456'), |
||
23 | ]); |
||
24 | |||
25 | $logged = auth()->attempt(['email' => $user->email, 'password' => '123456']); |
||
26 | |||
27 | $this->assertTrue($logged); |
||
28 | } |
||
29 | } |
||
30 |