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

RemoteClaimTest::testRemoteClaim()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 24
nc 1
nop 0
dl 0
loc 31
rs 8.8571
c 0
b 0
f 0
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