ERP-API/tests/Feature/Auth/LoginTest.php

30 lines
633 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 Illuminate\Foundation\Testing\DatabaseTransactions;
class LoginTest extends TestCase
{
use DatabaseTransactions;
/**
* A basic feature test example.
*/
public function test_success(): void
{
$user = User::factory()->create();
$response = $this->post('/auth/login',[
"email" => $user->email,
"password" => "password",
]);
$response->assertStatus(200);
}
}