1
|
|
|
<?php |
2
|
|
|
namespace Tests\Unit; |
3
|
|
|
|
4
|
|
|
use Lyal\Checkr\Entities\Screenings\MotorVehicleReport; |
5
|
|
|
use Tests\UnitTestCase; |
6
|
|
|
|
7
|
|
|
class MotorVehicleReportTest extends UnitTestCase |
8
|
|
|
{ |
9
|
|
|
public function testInstantiation() |
10
|
|
|
{ |
11
|
|
|
$this->assertInstanceOf('Lyal\Checkr\Entities\Screenings\MotorVehicleReport', $this->getMotorVehicleReport()); |
12
|
|
|
} |
13
|
|
|
|
14
|
|
|
public function testSetId() |
15
|
|
|
{ |
16
|
|
|
$motorVehicleReport = $this->getMotorVehicleReport(); |
17
|
|
|
$motorVehicleReport->id = 'e44aa283528e6fde7d542194'; |
|
|
|
|
18
|
|
|
$this->assertSame('e44aa283528e6fde7d542194', $motorVehicleReport->id); |
|
|
|
|
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public function testFields() |
22
|
|
|
{ |
23
|
|
|
$values = [ |
24
|
|
|
'id' => '539fd88c101897f7cd000007', |
25
|
|
|
'object' => 'motor_vehicle_report', |
26
|
|
|
'uri' => '/v1/motor_vehicle_reports/539fd88c101897f7cd000007', |
27
|
|
|
'status' => 'consider', |
28
|
|
|
'created_at' => '2014-01-18T12:34:00Z', |
29
|
|
|
'completed_at' => '2014-01-18T12:35:30Z', |
30
|
|
|
'turnaround_time' => 90, |
31
|
|
|
'full_name' => 'John Alfred Smith', |
32
|
|
|
'license_number' => 'F2111132', |
33
|
|
|
'license_state' => 'CA', |
34
|
|
|
'license_status' => 'valid', |
35
|
|
|
'license_type' => 'non-commercial', |
36
|
|
|
'license_class' => 'C', |
37
|
|
|
'expiration_date' => '2016-07-24', |
38
|
|
|
'issued_date' => '2006-12-03', |
39
|
|
|
'first_issued_date' => '2000-01-14', |
40
|
|
|
'inferred_issued_date' => NULL, |
41
|
|
|
'restrictions' => [], |
42
|
|
|
'accidents' => [ |
43
|
|
|
[ |
44
|
|
|
'accident_date' => '2009-04-12', |
45
|
|
|
'description' => 'property damage', |
46
|
|
|
'city' => NULL, |
47
|
|
|
'county' => 'SAN FRANCISCO', |
48
|
|
|
'state' => NULL, |
49
|
|
|
'order_number' => '33-435932', |
50
|
|
|
'points' => NULL, |
51
|
|
|
'vehicle_speed' => NULL, |
52
|
|
|
'reinstatement_date' => NULL, |
53
|
|
|
'action_taken' => 'police report filed', |
54
|
|
|
'ticket_number' => NULL, |
55
|
|
|
'enforcing_agency' => 'San Francisco PD', |
56
|
|
|
'jurisdiction' => NULL, |
57
|
|
|
'severity' => NULL, |
58
|
|
|
'violation_number' => NULL, |
59
|
|
|
'license_plate' => '6UM6938', |
60
|
|
|
'fine_amount' => NULL, |
61
|
|
|
'state_code' => NULL, |
62
|
|
|
'acd_code' => NULL, |
63
|
|
|
'injury_accident' => false, |
64
|
|
|
'fatality_accident' => false, |
65
|
|
|
'fatality_count' => 0, |
66
|
|
|
'injury_count' => 0, |
67
|
|
|
'vehicles_involved_count' => 1, |
68
|
|
|
'report_number' => NULL, |
69
|
|
|
'policy_number' => NULL, |
70
|
|
|
] |
71
|
|
|
], |
72
|
|
|
'violations' => [ |
73
|
|
|
[ |
74
|
|
|
'type' => 'conviction', |
75
|
|
|
'issued_date' => '2011-11-14', |
76
|
|
|
'conviction_date' => '2010-04-11', |
77
|
|
|
'description' => 'speeding 15-19 mph', |
78
|
|
|
'points' => 0, |
79
|
|
|
'city' => NULL, |
80
|
|
|
'county' => 'SANTA CLARA', |
81
|
|
|
'state' => 'California', |
82
|
|
|
'ticket_number' => '2D55555', |
83
|
|
|
'disposition' => NULL, |
84
|
|
|
'category' => NULL, |
85
|
|
|
'court_name' => NULL, |
86
|
|
|
'acd_code' => NULL, |
87
|
|
|
'state_code' => NULL, |
88
|
|
|
'docket' => NULL, |
89
|
|
|
] |
90
|
|
|
] |
91
|
|
|
]; |
92
|
|
|
|
93
|
|
|
$motorVehicleReport = $this->getMotorVehicleReport($values); |
94
|
|
|
|
95
|
|
|
foreach ($values as $key => $value) { |
96
|
|
|
if (is_array($value)) { |
97
|
|
|
$value = collect($value); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
$this->assertEquals($value, $motorVehicleReport->{$key}); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
protected function getMotorVehicleReport($values = NULL) |
106
|
|
|
{ |
107
|
|
|
return new MotorVehicleReport($values,$this->getClient()); |
108
|
|
|
} |
109
|
|
|
} |