Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use App\Models\User;
use Tests\TestCase;
use Hash, Auth;
class UserTest extends TestCase
{
/*public function test_authenticate_with_admin_success()
{
$user = User::factory()->create([
'role' => 'admin',
'password' => Hash::make('123123123')
]);
$response = $this->post('/nova/login', [
'email' => $user->email,
'password' => '123123123',
'remember' => false
]);
Auth::logout();
$user->delete();
$response->assertStatus(302);
}
public function test_authenticate_with_analyst_success()
{
$user = User::factory()->create([
'role' => 'analyst',
'password' => Hash::make('123123123')
]);
$response = $this->post('/nova/login', [
'email' => $user->email,
'password' => '123123123',
'remember' => false
]);
Auth::logout();
$user->delete();
$response->assertStatus(302);
}
public function test_authenticate_with_common_user()
{
$user = User::factory()->create([
'role' => 'common',
'password' => Hash::make('123123123')
]);
$response = $this->post('/nova/login', [
'email' => $user->email,
'password' => '123123123',
'remember' => false
]);
Auth::logout();
$user->delete();
$response->assertStatus(302);
}
public function test_authenticate_without_password()
{
$user = User::factory()->create([
'role' => 'common',
'password' => Hash::make('123123123')
]);
$response = $this->post('/nova/login', [
'email' => $user->email,
'password' => '12312312',
'remember' => false
]);
$user->delete();
$response->assertStatus(302);
}*/
}