MOON
Server: Apache
System: Linux e2e-78-16.ssdcloudindia.net 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
User: imensosw (1005)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/imensosw/.trash/tests.1/Unit/Admin/LoginTest.php
<?php

namespace Tests\Unit\Admin;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithoutMiddleware;
use App\Models\Client;

class LoginTest extends TestCase
{
    protected $users , $clientData;
    protected function setUp(): void 
    {
       parent::setUp();

       $user = factory(\App\User::class)->make();
       $this->users = $user;
    }
    
   /* public function test_check_user_in_database()
    {
        $this->assertDatabaseHas('users', [
           'email' => 'admin@gmail.com',
        ]);
    }
*/

    /**
     * A basic feature test example.
     *
     * @return void
     */
    public function test_admin_login()
    {
        $this->withoutMiddleware();
       
        
        $response = $this->actingAs($this->users)->json('GET','/admin/translators');
        $response->assertOk();

    }

    public function tearDown(): void
    {
     
        $maxId = \DB::table('users')->max('id');
        \DB::statement('ALTER TABLE users AUTO_INCREMENT=' . intval($maxId + 1) . ';');
        parent::tearDown();
    }

    

}