Test Failed
Push — master ( 6bff04...e0da10 )
by Lyal
02:14
created

SsnTraceTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
dl 0
loc 70
c 0
b 0
f 0
rs 10
1
<?php
2
namespace Tests\Unit;
3
4
5
use Lyal\Checkr\Entities\Screenings\SsnTrace;
6
use Tests\UnitTestCase;
7
8
class SsnTraceTest extends UnitTestCase
9
{
10
    public function testInstantiation()
11
    {
12
        $this->assertInstanceOf('Lyal\Checkr\Entities\Screenings\SsnTrace', $this->getSsnTrace());
13
    }
14
15
    public function testSetId()
16
    {
17
        $ssnTrace = $this->getSsnTrace();
18
        $ssnTrace->id = 'e44aa283528e6fde7d542194';
19
        $this->assertSame('e44aa283528e6fde7d542194', $ssnTrace->id);
20
    }
21
22
    public function testFields()
23
    {
24
        $values = [
25
            'id' => '539fd88c101897f7cd000001',
26
            'object' => 'ssn_trace',
27
            'uri' => '/v1/ssn_traces/539fd88c101897f7cd000001',
28
            'status' => 'clear',
29
            'created_at' => '2014-01-18T12:34:00Z',
30
            'completed_at' => '2014-01-18T12:35:30Z',
31
            'turnaround_time' => 90,
32
            'ssn' => 'XXX-XX-4645',
33
            'addresses' => [
34
                [
35
                    'street' => '123 S Folsom St',
36
                    'unit' => 'Apt 54B',
37
                    'city' => 'San Francisco',
38
                    'state' => 'CA',
39
                    'zipcode' => '94110',
40
                    'county' => 'SAN FRANCISCO',
41
                    'from_date' => '2010-05-01',
42
                    'to_date' => '2014-06-01',
43
                ],
44
                [
45
                    'street' => '1230 5th Avenue',
46
                    'unit' => NULL,
47
                    'city' => 'New York',
48
                    'state' => 'NY',
49
                    'zipcode' => '1005',
50
                    'county' => 'NEW YORK',
51
                    'from_date' => '2007-07-01',
52
                    'to_date' => '2010-05-01',
53
                ]
54
            ],
55
            'aliases' => [
56
                ['first_name' => 'Jack',
57
                    'middle_name' => 'B',
58
                    'last_name' => 'Fieldman',
59
                ]
60
            ]
61
        ];
62
63
        $ssnTrace = $this->getSsnTrace($values);
64
65
        foreach ($values as $key => $value) {
66
            if (is_array($value)) {
67
                $value = collect($value);
68
            }
69
70
            $this->assertEquals($value, $ssnTrace->{$key});
71
        }
72
73
    }
74
75
    protected function getSsnTrace($values = NULL)
76
    {
77
        return new SsnTrace($values,$this->getClient());
78
    }
79
}