improve 4 test

This commit is contained in:
2025-05-11 11:10:40 +03:30
parent 0a2b324041
commit f2fda29041
4 changed files with 196 additions and 197 deletions

View File

@@ -12,33 +12,6 @@ class LoginTest extends TestCase
{
use RefreshDatabase, WithFaker;
// public function test_user_can_login()
// {
// $this->withoutExceptionHandling();
//
// $this->artisan('passport:install');
//
// $user = User::factory()->create();
//
// $response = $this->postJson('/api/auth/login', [
// 'username' => $user->username,
// 'password' => 'password',
// ]);
//
// $token = Token::where('user_id', $user->id)->first();
//
// $response->assertStatus(200)
// ->assertJson([
// 'message' => __('messages.successful')
// ]);
//
// $this->assertDatabaseHas('oauth_access_tokens' , [
// 'user_id' => $user->id,
// ]);
//
// $this->assertInstanceOf(Token::class, $token);
// }
public function test_user_can_login()
{
$user = User::factory()
@@ -85,6 +58,7 @@ class LoginTest extends TestCase
'password' => __('validation.required', ['attribute' => 'رمز عبور'])
]);
}
public function test_telephone_id_is_required()
{
$response = $this->postJson('/server/auth/login', [