1
|
|
|
<?php |
2
|
|
|
namespace Tests\Unit; |
3
|
|
|
|
4
|
|
|
use Lyal\Checkr\Entities\Resources\Report; |
5
|
|
|
use Tests\UnitTestCase; |
6
|
|
|
|
7
|
|
|
class ReportTest extends UnitTestCase |
8
|
|
|
{ |
9
|
|
|
public function testInstantiation() |
10
|
|
|
{ |
11
|
|
|
$this->assertInstanceOf('Lyal\Checkr\Entities\Resources\Report', $this->getReport()); |
12
|
|
|
} |
13
|
|
|
|
14
|
|
|
public function testSetId() |
15
|
|
|
{ |
16
|
|
|
$report = $this->getReport(); |
17
|
|
|
$report->id = 'e44aa283528e6fde7d542194'; |
18
|
|
|
$this->assertSame('e44aa283528e6fde7d542194',$report->id); |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public function testFields() |
22
|
|
|
{ |
23
|
|
|
$values = [ |
24
|
|
|
'id' => '4722c07dd9a10c3985ae432a', |
25
|
|
|
'object' => 'report', |
26
|
|
|
'uri' => '/v1/reports/4722c07dd9a10c3985ae432a', |
27
|
|
|
'status' => 'clear', |
28
|
|
|
'created_at' => '2014-01-18T12:34:00Z', |
29
|
|
|
'completed_at' => '2014-01-18T12:35:30Z', |
30
|
|
|
'revised_at' => NULL, |
31
|
|
|
'turnaround_time' => 90, |
32
|
|
|
'due_time' => '2014-01-19T11:28:31Z', |
33
|
|
|
'adjudication' => 'engaged', |
34
|
|
|
'package' => 'driver_pro', |
35
|
|
|
'candidate_id' => 'e44aa283528e6fde7d542194', |
36
|
|
|
'ssn_trace_id' => '539fd88c101897f7cd000001', |
37
|
|
|
'sex_offender_search_id' => '539fd88c101897f7cd000008', |
38
|
|
|
'national_criminal_search_id' => '539fd88c101897f7cd000006', |
39
|
|
|
'county_criminal_search_ids' => [ |
40
|
|
|
'539fdcf335644a0ef4000001', |
41
|
|
|
'532e71cfe88a1d4e8d00000c', |
42
|
|
|
], |
43
|
|
|
'motor_vehicle_report_id' => '539fd88c101897f7cd000007', |
44
|
|
|
'state_criminal_search_ids' => |
45
|
|
|
[ |
46
|
|
|
'539fdcf335644a0ef4000003', |
47
|
|
|
'532e71cfe88a1d4e8d000004', |
48
|
|
|
], |
49
|
|
|
'document_ids' => [], |
50
|
|
|
'geo_ids' => |
51
|
|
|
[ |
52
|
|
|
'87f5bb4983eade22c55f4731', |
53
|
|
|
], |
54
|
|
|
'program_id' => '00166f9ff39ec7b453adfaec', |
55
|
|
|
]; |
56
|
|
|
|
57
|
|
|
$report = $this->getReport($values); |
58
|
|
|
|
59
|
|
|
foreach ($values as $key => $value) { |
60
|
|
|
if (is_array($value)) { |
61
|
|
|
$value = collect($value); |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
$this->assertEquals($value, $report->{$key}); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
protected function getReport($values = NULL) |
70
|
|
|
{ |
71
|
|
|
return new Report($values,$this->getClient()); |
72
|
|
|
} |
73
|
|
|
} |