Completed
Push — master ( 24f6ce...c3efa2 )
by Guilherme
05:36
created

ProcergsLinkTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 32
rs 10
wmc 2
lcom 0
cbo 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testEntity() 0 21 1
A testInvalidType() 0 7 1
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 PROCERGS\LoginCidadao\AccountingBundle\Entity\ProcergsLink;
15
16
/**
17
 * @codeCoverageIgnore
18
 */
19
class ProcergsLinkTest extends \PHPUnit_Framework_TestCase
20
{
21
    public function testEntity()
22
    {
23
        $client = new Client();
24
        $updatedAt = new \DateTime();
25
        $createdAt = new \DateTime();
26
27
        $link = new ProcergsLink();
28
        $link
29
            ->setClient($client)
30
            ->setSystemType(ProcergsLink::TYPE_INTERNAL)
31
            ->setCreatedAtValue();
32
33
        $link
34
            ->setUpdatedAt($updatedAt)
35
            ->setCreatedAt($createdAt);
36
37
        $this->assertNull($link->getId());
38
        $this->assertEquals($client, $link->getClient());
39
        $this->assertEquals($updatedAt, $link->getUpdatedAt());
40
        $this->assertEquals($createdAt, $link->getCreatedAt());
41
    }
42
43
    public function testInvalidType()
44
    {
45
        $this->setExpectedException('\InvalidArgumentException');
46
47
        $link = new ProcergsLink();
48
        $link->setSystemType('INVALID');
49
    }
50
}
51