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();
}
}