Failed Conditions
Push — issue#785 ( 0adb82...cc35f8 )
by Guilherme
04:03
created

RemoteClaimAuthorizationTest::testRemoteClaimAuthorization()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 16
nc 1
nop 0
dl 0
loc 26
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\RemoteClaimAuthorization;
14
use LoginCidadao\OAuthBundle\Model\ClientInterface;
15
use LoginCidadao\RemoteClaimsBundle\Model\ClaimProviderInterface;
16
use LoginCidadao\RemoteClaimsBundle\Model\TagUri;
17
use LoginCidadao\CoreBundle\Model\PersonInterface;
18
use PHPUnit\Framework\TestCase;
19
20
class RemoteClaimAuthorizationTest extends TestCase
21
{
22
    public function testRemoteClaimAuthorization()
23
    {
24
        /** @var \PHPUnit_Framework_MockObject_MockObject|ClientInterface $client */
25
        $client = $this->createMock('LoginCidadao\OAuthBundle\Model\ClientInterface');
26
27
        /** @var \PHPUnit_Framework_MockObject_MockObject|ClaimProviderInterface $provider */
28
        $provider = $this->createMock('LoginCidadao\RemoteClaimsBundle\Model\ClaimProviderInterface');
29
30
        /** @var \PHPUnit_Framework_MockObject_MockObject|PersonInterface $person */
31
        $person = $this->createMock('LoginCidadao\CoreBundle\Model\PersonInterface');
32
33
        $claimName = new TagUri();
34
        $accessToken = 'my_accessToken';
35
36
        $auth = (new RemoteClaimAuthorization())
37
            ->setClaimProvider($provider)
38
            ->setClient($client)
39
            ->setClaimName($claimName)
40
            ->setAccessToken($accessToken)
41
            ->setPerson($person);
42
43
        $this->assertEquals($client, $auth->getClient());
44
        $this->assertEquals($provider, $auth->getClaimProvider());
45
        $this->assertEquals($claimName, $auth->getClaimName());
46
        $this->assertEquals($accessToken, $auth->getAccessToken());
47
        $this->assertEquals($person, $auth->getPerson());
48
    }
49
}
50