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

EducationVerificationTest   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 6
dl 0
loc 79
c 0
b 0
f 0
rs 10
1
<?php
2
namespace Tests\Unit;
3
4
use Lyal\Checkr\Entities\Screenings\EducationVerification;
5
use Tests\UnitTestCase;
6
7
class EducationVerificationTest extends UnitTestCase
8
{
9
    public function testInstantiation()
10
    {
11
        $this->assertInstanceOf('Lyal\Checkr\Entities\Screenings\EducationVerification', $this->getEducationVerification());
12
    }
13
14
    public function testSetId()
15
    {
16
        $educationVerification = $this->getEducationVerification();
17
        $educationVerification->id = 'e44aa283528e6fde7d542194';
18
        $this->assertSame('e44aa283528e6fde7d542194', $educationVerification->id);
19
    }
20
21
    public function testFields()
22
    {
23
        $values = [
24
            'id' => '595511af261066005170f471',
25
            'object' => 'education_verification',
26
            'uri' => '/v1/education_verifications/595511af261066005170f471',
27
            'completed_at' => '2017-07-06T14:15:27Z',
28
            'created_at' => '2017-06-29T14:41:51Z',
29
            'records' => [
30
                'id' => '592311d2113adf7e9c9f66b8',
31
                'result' => [
32
                    'degree' => [
33
                        'verified' => false,
34
                    ]
35
                ],
36
                'school' => [
37
                    'candidate_id' => '762781cdd1c7fd620e956583',
38
                    'id' => '95a95172bb81143ed44e403c',
39
                    'uri' => '/v1/candidates/762781cdd1c7fd620e956583/schools/95a95172bb81143ed44e403c',
40
                    'name' => 'College University',
41
                    'address' =>
42
                        [
43
                            'street' => '1 Circle Avenue',
44
                            'city' => 'San Francisco',
45
                            'zipcode' => '94105',
46
                            'state' => 'CA',
47
                            'country' => 'US',
48
                        ],
49
                    'degree' => 'MS',
50
                    'year_awarded' => 2017,
51
                    'major' => 'Computer Science',
52
                    'phone' => '415-111-1111',
53
                    'minor' => 'Background Checks',
54
                    'start_date' => '2013-08-25',
55
                    'end_date' => '2017-05-10',
56
                    'current' => false,
57
                    'object' => 'candidate_school',
58
                    'events' => [
59
                        [
60
                            'text' => 'started',
61
                            'created_at' => '2017-06-29T14:42:47Z',
62
                            'type' => 'verification_start',
63
                        ]
64
                    ],
65
                    'status' => 'consider'
66
                ]
67
            ],
68
            'status' => 'consider',
69
            'turnaround_time' => 603216,
70
        ];
71
72
        $educationVerification = $this->getEducationVerification($values);
73
74
        foreach ($values as $key => $value) {
75
            if (is_array($value)) {
76
                $value = collect($value);
77
            }
78
            $this->assertEquals($value, $educationVerification->{$key});
79
        }
80
81
    }
82
83
    protected function getEducationVerification($values = NULL)
84
    {
85
        return new EducationVerification($values,$this->getClient());
86
    }
87
}