Test Failed
Push — master ( 7c4720...fd955c )
by Lyal
04:00 queued 14s
created

GlobalWatchListSearchTest::testSetId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
namespace Tests\Unit;
3
4
use Lyal\Checkr\Entities\Screenings\GlobalWatchlistSearch;
5
use Tests\UnitTestCase;
6
7
class GlobalWatchListSearchTest extends UnitTestCase
8
{
9
    public function testInstantiation()
10
    {
11
        $this->assertInstanceOf('Lyal\Checkr\Entities\Screenings\GlobalWatchListSearch', $this->getGlobalWatchListSearch());
12
    }
13
14
    public function testSetId()
15
    {
16
        $globalWatchListSearch = $this->getGlobalWatchListSearch();
17
        $globalWatchListSearch->id = 'e44aa283528e6fde7d542194';
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on Lyal\Checkr\Entities\Scr...s\GlobalWatchlistSearch. Since you implemented __set, consider adding a @property annotation.
Loading history...
18
        $this->assertSame('e44aa283528e6fde7d542194', $globalWatchListSearch->id);
0 ignored issues
show
Bug Best Practice introduced by
The property id does not exist on Lyal\Checkr\Entities\Scr...s\GlobalWatchlistSearch. Since you implemented __get, consider adding a @property annotation.
Loading history...
19
    }
20
21
    public function testFields()
22
    {
23
        $values = [
24
            'id' => '539fd88c101897f7cd000008',
25
            'object' => 'global_watchlist_search',
26
            'uri' => '/v1/global_watchlist_searches/539fd88c101897f7cd000008',
27
            'status' => 'consider',
28
            'created_at' => '2014-01-18T12:34:00Z',
29
            'completed_at' => '2014-01-18T12:35:30Z',
30
            'turnaround_time' => 90,
31
            'records' => [
32
                [
33
                    'case_number' => '24323-DA',
34
                    'file_date' => NULL,
35
                    'arresting_agency' => 'DEA Boston Division',
36
                    'court_jurisdiction' => NULL,
37
                    'court_of_record' => NULL,
38
                    'dob' => '1970-01-22',
39
                    'full_name' => 'John Alfred Smith',
40
                    'charges' => [
41
                        [
42
                            'charge' => 'RICO murder',
43
                            'charge_type' => NULL,
44
                            'charge_id' => NULL,
45
                            'classification' => 'Felony',
46
                            'deposition' => NULL,
47
                            'defendant' => NULL,
48
                            'plaintiff' => NULL,
49
                            'sentence' => 'Active Punishment Minimum: 10Y',
50
                            'disposition' => 'Guilty',
51
                            'probation_status' => NULL,
52
                            'offense_date' => '2011-04-22',
53
                            'deposition_date' => '2014-05-27',
54
                            'arrest_date' => NULL,
55
                            'charge_date' => NULL,
56
                            'sentence_date' => NULL,
57
                            'disposition_date' => '2011-06-02',
58
                        ]
59
                    ]
60
                ]
61
            ]
62
        ];
63
        $globalWatchListSearch = $this->getGlobalWatchListSearch($values);
64
65
        foreach ($values as $key => $value) {
66
            if (is_array($value)) {
67
                $value = collect($value);
68
            }
69
70
            $this->assertEquals($value, $globalWatchListSearch->{$key});
71
        }
72
73
    }
74
75
    protected function getGlobalWatchListSearch($values = NULL)
76
    {
77
        return new GlobalWatchlistSearch($values,$this->getClient());
78
    }
79
}