Completed
Branch master (910c19)
by Dmitri
01:43
created

SecurityClaimsTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Damax\Bundle\ApiAuthBundle\Tests\Jwt\Claims;
6
7
use Damax\Bundle\ApiAuthBundle\Jwt\Claims\SecurityClaims;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\Security\Core\Role\Role;
10
use Symfony\Component\Security\Core\User\User;
11
12
class SecurityClaimsTest extends TestCase
13
{
14
    /**
15
     * @test
16
     */
17
    public function it_resolves_claims()
18
    {
19
        $user = new User('[email protected]', 'qwerty', ['ROLE_USER', new Role('ROLE_ADMIN')]);
20
21
        $claims = (new SecurityClaims())->resolve($user);
22
23
        $this->assertEquals(['sub' => '[email protected]', 'roles' => ['user', 'admin']], $claims);
24
    }
25
}
26