Repository navigation
Expand file tree
/
Copy pathBasicTest.php
More file actions
114 lines (102 loc) · 3.02 KB
/
Copy pathBasicTest.php
File metadata and controls
114 lines (102 loc) · 3.02 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
namespace Tests\Unit;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Session;
use Illuminate\Http\Response as Responce;
use App\Http\Controllers;
use App\FirebaseDb;
class BasicTest extends TestCase
{
public function testLeaveRequest(){
$data = [
'username'=>'Hs1013',
'password'=>'1234567'
];
Session::put('user',$data);
$response = $this->call('GET', '/leave-requests/');
$response->assertOk();
}
public function testShowDepartment(){
$data = [
'username'=>'Hs1013',
'password'=>'1234567'
];
Session::put('user',$data);
$response = $this->call('GET', '/departments/');
$response->assertStatus(200);
}
public function testShowAttendance(){
$data = [
'username'=>'Hs1013',
'password'=>'1234567'
];
Session::put('user',$data);
$response = $this->call('GET', '/attendance/');
$response->assertStatus(200);
}
public function testShowProfile(){
$data = [
'username'=>'Hs1013',
'password'=>'1234567'
];
Session::put('user',$data);
$response = $this->call('GET', '/profile/');
$response->assertStatus(200);
}
/*false positive */
public function testSaveEmployee(){
$data = [
'username'=>'Hs1113',
'password'=>'Hs1013',
'first_name' => 'Harry',
'last_name' => 'singh',
'email' => 'herry@hmail.com',
'employee_id' => 'Hs1113',
'joining_date' => now(),
'phone' => '677-090-1881',
'designation' => 'manager',
'last_numeric_employee_id' =>'1113'
];
Session::put('user',$data);
$response = $this->call('POST', '/saveEmployee/',$data);
$response->assertStatus(302);
}
public function testReport(){
$data = [
'username'=>'Hs1013',
'password'=>'1234567'
];
Session::put('user',$data);
$response = $this->call('GET', '/generate_report/');
$response->assertStatus(200);
}
/*False Positive*/
public function testAddAttendance(){
$data = [
'username'=>'Hs1013',
'password'=>'Hs1013'
];
Session::put('user',$data);
$response = $this->call('POST', '/saveAttendance2/');
$response->assertStatus(500);
}
public function testGetReport(){
$data = [
'username'=>'Hs1013',
'password'=>'1234567'
];
Session::put('user',$data);
$response = $this->call('POST', '/get_report/');
$response->assertStatus(302);
}
public function testShowDesignations(){
$data = [
'username'=>'Hs1013',
'password'=>'1234567'
];
Session::put('user',$data);
$response = $this->call('POST', '/designations/');
$response->assertStatus(405);
}
}