JWSCreatorTest::testCreateUnsignedJWT()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 6
rs 10
1
<?php
2
/*
3
 * This file is part of the Guarded Authentication package.
4
 *
5
 * (c) Jafar Jabr <[email protected]>
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 Jafar\Bundle\GuardedAuthenticationBundle\Tests\Api\JWSCreator;
12
13
use Jafar\Bundle\GuardedAuthenticationBundle\Api\JWSCreator\JWSCreator;
14
use PHPUnit\Framework\TestCase;
15
16
/**
17
 * Class JWSCreatorTest.
18
 *
19
 * @author Jafar Jabr <[email protected]>
20
 */
21
class JWSCreatorTest extends TestCase
22
{
23
    const TOKEN = 'test Token';
24
25
    public function testCreateSignedJTW()
26
    {
27
        $jws = new JWSCreator(self::TOKEN, true);
28
29
        $this->assertSame(self::TOKEN, $jws->getToken());
30
        $this->assertTrue($jws->isSigned());
31
    }
32
33
    public function testCreateUnsignedJWT()
34
    {
35
        $jws = new JWSCreator(self::TOKEN, false);
36
37
        $this->assertSame(self::TOKEN, $jws->getToken());
38
        $this->assertFalse($jws->isSigned());
39
    }
40
}
41