1
|
|
|
<?php |
2
|
|
|
namespace Tests\Unit; |
3
|
|
|
|
4
|
|
|
use Lyal\Checkr\Entities\Resources\AdverseAction; |
5
|
|
|
use Tests\UnitTestCase; |
6
|
|
|
|
7
|
|
|
class AdverseActionTest extends UnitTestCase |
8
|
|
|
{ |
9
|
|
|
public function testInstantiation() |
10
|
|
|
{ |
11
|
|
|
$this->assertInstanceOf('Lyal\Checkr\Entities\Resources\AdverseAction', $this->getAdverseAction()); |
12
|
|
|
} |
13
|
|
|
|
14
|
|
|
public function testSetId() |
15
|
|
|
{ |
16
|
|
|
$adverseAction = $this->getAdverseAction(); |
17
|
|
|
$adverseAction->id = 'e44aa283528e6fde7d542194'; |
18
|
|
|
$this->assertSame('e44aa283528e6fde7d542194', $adverseAction->id); |
19
|
|
|
} |
20
|
|
|
|
21
|
|
|
public function testFields() |
22
|
|
|
{ |
23
|
|
|
$values = [ |
24
|
|
|
'id' => '57ed51e57619e8002a6683f2', |
25
|
|
|
'object' => 'adverse_action', |
26
|
|
|
'uri' => '/v1/adverse_actions/57ed51e57619e8002a6683f2', |
27
|
|
|
'created_at' => '2016-09-29T17:39:49Z', |
28
|
|
|
'status' => 'pending', |
29
|
|
|
'report_id' => 'b861a56db1b1b89692dd6118', |
30
|
|
|
'post_notice_scheduled_at' => '2016-10-07T12:34:00Z', |
31
|
|
|
'post_notice_ready_at' => '2016-10-06T17:39:48Z', |
32
|
|
|
'canceled_at' => NULL, |
33
|
|
|
'adverse_items' => |
34
|
|
|
collect([ |
35
|
|
|
[ |
36
|
|
|
'id' => '57ed4ce3057e0b002adc6d90', |
37
|
|
|
'object' => 'adverse_item', |
38
|
|
|
'text' => 'CHARGE: DELIVER COCAINE (STATUTE: 90-95(A)(1)) (DISPOSITION: DISMISSAL W/O LEAVE)', |
39
|
|
|
], |
40
|
|
|
['id' => '57ed4ce3057e0b002adc6d91', |
41
|
|
|
'object' => 'adverse_item', |
42
|
|
|
'text' => 'CHARGE: RESISTING PUBLIC OFFICER (STATUTE: 14-223) (DISPOSITION: DISMISSAL W/O LEAVE)', |
43
|
|
|
] |
44
|
|
|
]), |
45
|
|
|
]; |
46
|
|
|
|
47
|
|
|
$adverseAction = $this->getAdverseAction($values); |
48
|
|
|
|
49
|
|
|
foreach ($values as $key => $value) { |
50
|
|
|
$this->assertEquals($value, $adverseAction->{$key}); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
protected function getAdverseAction($values = NULL) |
56
|
|
|
{ |
57
|
|
|
return new AdverseAction($values,$this->getClient()); |
58
|
|
|
} |
59
|
|
|
} |
60
|
|
|
|