Completed
Push — issue#666 ( 928a8e...2654e9 )
by Guilherme
04:24
created

RemoteClaimTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 34
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 4

1 Method

Rating   Name   Duplication   Size   Complexity  
B testRemoteClaim() 0 31 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 LoginCidadao\RemoteClaimsBundle\Tests\Entity;
12
13
use LoginCidadao\RemoteClaimsBundle\Entity\RemoteClaim;
14
use LoginCidadao\RemoteClaimsBundle\Model\ClaimProviderInterface;
15
use LoginCidadao\RemoteClaimsBundle\Model\RemoteClaimInterface;
16
use LoginCidadao\RemoteClaimsBundle\Model\TagUri;
17
18
class RemoteClaimTest extends \PHPUnit_Framework_TestCase
19
{
20
    public function testRemoteClaim()
21
    {
22
        $id = 'id';
23
        $name = new TagUri();
24
        $displayName = 'some claim';
25
        $description = 'about my claim';
26
        $recommended = ['scope1', 'scope2'];
27
        $essential = ['scope2', 'scope3'];
28
29
        /** @var ClaimProviderInterface $provider */
30
        $provider = $this->getMock('LoginCidadao\RemoteClaimsBundle\Model\ClaimProviderInterface');
31
32
        /** @var RemoteClaimInterface|RemoteClaim $remoteClaim */
33
        $remoteClaim = (new RemoteClaim())
34
            ->setId($id)
35
            ->setName($name)
36
            ->setDisplayName($displayName)
37
            ->setDescription($description)
38
            ->setProvider($provider)
39
            ->setRecommendedScope($recommended)
40
            ->setEssentialScope($essential);
41
42
        $this->assertInstanceOf('LoginCidadao\RemoteClaimsBundle\Model\RemoteClaimInterface', $remoteClaim);
43
        $this->assertEquals($id, $remoteClaim->getId());
44
        $this->assertEquals($name, $remoteClaim->getName());
45
        $this->assertEquals($displayName, $remoteClaim->getDisplayName());
46
        $this->assertEquals($description, $remoteClaim->getDescription());
47
        $this->assertEquals($provider, $remoteClaim->getProvider());
48
        $this->assertEquals($recommended, $remoteClaim->getRecommendedScope());
49
        $this->assertEquals($essential, $remoteClaim->getEssentialScope());
50
    }
51
}
52