Completed
Pull Request — master (#790)
by Guilherme
08:21 queued 04:10
created

ProcergsLinkTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 2
1
<?php
2
/**
3
 * This file is part of the login-cidadao project or it's bundles.
4
 *
5
 * (c) Guilherme Donato <guilhermednt on github>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace PROCERGS\LoginCidadao\AccountingBundle\Tests\Entity;
12
13
use LoginCidadao\OAuthBundle\Entity\Client;
14
use PHPUnit\Framework\TestCase;
15
use PROCERGS\LoginCidadao\AccountingBundle\Entity\ProcergsLink;
16
17
/**
18
 * @codeCoverageIgnore
19
 */
20
class ProcergsLinkTest extends TestCase
21
{
22
    public function testEntity()
23
    {
24
        $client = new Client();
25
        $updatedAt = new \DateTime();
26
        $createdAt = new \DateTime();
27
28
        $link = new ProcergsLink();
29
        $link
30
            ->setClient($client)
31
            ->setSystemType(ProcergsLink::TYPE_INTERNAL)
32
            ->setCreatedAtValue();
33
34
        $link
35
            ->setUpdatedAt($updatedAt)
36
            ->setCreatedAt($createdAt);
37
38
        $this->assertNull($link->getId());
39
        $this->assertEquals($client, $link->getClient());
40
        $this->assertEquals($updatedAt, $link->getUpdatedAt());
41
        $this->assertEquals($createdAt, $link->getCreatedAt());
42
    }
43
44
    public function testInvalidType()
45
    {
46
        $this->expectException(\InvalidArgumentException::class);
47
48
        $link = new ProcergsLink();
49
        $link->setSystemType('INVALID');
50
    }
51
}
52