Completed
Push — master ( 2978b4...deca97 )
by Thomas Mauro
01:55
created

AuthSessionTest::testSetCodeVerifier()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Facile\OpenIDClientTest\Session;
6
7
use Facile\OpenIDClient\Session\AuthSession;
8
use function json_decode;
9
use function json_encode;
10
use PHPUnit\Framework\TestCase;
11
12
class AuthSessionTest extends TestCase
13
{
14
    public function testSetState(): void
15
    {
16
        $session = new AuthSession();
17
18
        static::assertNull($session->getState());
0 ignored issues
show
Bug introduced by
The method assertNull() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
20
        $session->setState('foo');
21
22
        static::assertSame('foo', $session->getState());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
    }
24
25
    public function testSetNonce(): void
26
    {
27
        $session = new AuthSession();
28
29
        static::assertNull($session->getNonce());
0 ignored issues
show
Bug introduced by
The method assertNull() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
30
31
        $session->setNonce('foo');
32
33
        static::assertSame('foo', $session->getNonce());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
34
    }
35
36
    public function testSetCodeVerifier(): void
37
    {
38
        $session = new AuthSession();
39
40
        static::assertNull($session->getCodeVerifier());
0 ignored issues
show
Bug introduced by
The method assertNull() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
41
42
        $session->setCodeVerifier('foo');
43
44
        static::assertSame('foo', $session->getCodeVerifier());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
45
    }
46
47
    public function testSetCustoms(): void
48
    {
49
        $session = new AuthSession();
50
51
        static::assertSame([], $session->getCustoms());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
52
53
        $session->setCustoms(['foo' => 'bar']);
54
55
        static::assertSame(['foo' => 'bar'], $session->getCustoms());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
56
    }
57
58
    public function testFromArray(): void
59
    {
60
        $session = AuthSession::fromArray([
61
            'state' => 'foo',
62
            'nonce' => 'bar',
63
        ]);
64
65
        static::assertSame('foo', $session->getState());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
66
        static::assertSame('bar', $session->getNonce());
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
67
    }
68
69
    public function testJsonSerializer(): void
70
    {
71
        $session = AuthSession::fromArray([
72
            'state' => 'foo',
73
            'nonce' => 'bar',
74
        ]);
75
76
        static::assertSame([
0 ignored issues
show
Bug introduced by
The method assertSame() does not seem to exist on object<Facile\OpenIDClie...ession\AuthSessionTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
77
            'state' => 'foo',
78
            'nonce' => 'bar',
79
        ], json_decode(json_encode($session), true));
80
    }
81
}
82