<?php

namespace Mehrab\User\Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Support\Facades\Hash;
use Mehrab\User\Models\User;
use Tests\TestCase;

class LoginTest extends TestCase
{
    use RefreshDatabase,WithFaker;
    /**
     * A basic feature test example.
     *
     * @return void
     */
    public function test_user_verified_can_login(){

        User::query()->create([
            'mobile' => '09358787882',
            'password' => Hash::make('123456Hb'),
            'mobile_verified_at' => time(),
        ]);

        $response = $this->login();

        $this->assertAuthenticated();


    }

    public function login(){
        $this->post(route('auth.login_user'),[
            'mobile' => '09358787882',
            'password' => '123456Hb',
        ]);
    }
}
