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

OrganizationClaimsTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
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\OrganizationClaims;
8
use PHPUnit\Framework\TestCase;
9
use Symfony\Component\Security\Core\User\User;
10
11
class OrganizationClaimsTest extends TestCase
12
{
13
    /**
14
     * @test
15
     */
16
    public function it_resolves_no_claims()
17
    {
18
        $user = new User('[email protected]', 'qwerty');
19
20
        $this->assertEmpty((new OrganizationClaims())->resolve($user));
21
    }
22
23
    /**
24
     * @test
25
     */
26
    public function it_resolves_claims()
27
    {
28
        $user = new User('[email protected]', 'qwerty');
29
30
        $claims = (new OrganizationClaims('github', 'app'))->resolve($user);
31
32
        $this->assertEquals(['iss' => 'github', 'aud' => 'app'], $claims);
33
    }
34
}
35