Code Duplication    Length = 39-39 lines in 2 locations

tests/unit/GeoTest.php 1 location

@@ 8-46 (lines=39) @@
5
use Lyal\Checkr\Entities\Resources\Geo;
6
use Tests\UnitTestCase;
7
8
class GeoTest extends UnitTestCase
9
{
10
    public function testInstantiation()
11
    {
12
        $this->assertInstanceOf('Lyal\Checkr\Entities\Resources\Geo', $this->getGeo());
13
    }
14
15
    public function testSetId()
16
    {
17
        $geo = $this->getGeo();
18
        $geo->id = 'e44aa283528e6fde7d542194';
19
        $this->assertSame('e44aa283528e6fde7d542194', $geo->id);
20
    }
21
22
    public function testFields()
23
    {
24
        $values = [
25
            'id' => 'e44aa283528e6fde7d542194',
26
            'object' => 'geo',
27
            'uri' => '/v1/geos/e44aa283528e6fde7d542194',
28
            'created_at' => '2015-01-18T12:34:00Z',
29
            'name' => 'San Francisco',
30
            'state' => 'CA',
31
            'deleted_at' => NULL,
32
        ];
33
34
        $geo = $this->getGeo($values);
35
36
        foreach ($values as $key => $value) {
37
            $this->assertEquals($value, $geo->{$key});
38
        }
39
40
    }
41
42
    protected function getGeo($values = NULL)
43
    {
44
        return new Geo($values,$this->getClient());
45
    }
46
}

tests/unit/VerificationTest.php 1 location

@@ 7-45 (lines=39) @@
4
use Lyal\Checkr\Entities\Resources\Verification;
5
use Tests\UnitTestCase;
6
7
class VerificationTest extends UnitTestCase
8
{
9
    public function testInstantiation()
10
    {
11
        $this->assertInstanceOf('Lyal\Checkr\Entities\Resources\Verification', $this->getVerification());
12
    }
13
14
    public function testSetId()
15
    {
16
        $verification = $this->getVerification();
17
        $verification->id = 'e44aa283528e6fde7d542194';
18
        $this->assertSame('e44aa283528e6fde7d542194', $verification->id);
19
    }
20
21
    public function testFields()
22
    {
23
        $values = [
24
            'id' => 'db313e73383710d4fa2f18fd',
25
            'object' => 'verification',
26
            'uri' => 'https://api.checkr.com/v1/reports/4722c07dd9a10c3985ae432/verifications/db313e73383710d4fa2f18fd',
27
            'created_at' => '2014-01-18T12:34:00Z',
28
            'completed_at' => NULL,
29
            'verification_type' => 'id',
30
            'verification_url' => 'http://verifications.checkr.com/db313e73383710d4fa2f18fd',
31
        ];
32
33
        $verification = $this->getVerification($values);
34
35
        foreach ($values as $key => $value) {
36
            $this->assertEquals($value, $verification->{$key});
37
        }
38
39
    }
40
41
    protected function getVerification($values = NULL)
42
    {
43
        return new Verification($values,$this->getClient());
44
    }
45
}