Completed
Push — master ( 854a6f...c7bd33 )
by Chad
12s
created

TokenTest::getSignature()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace ChadicusTest\Psr\Http\ServerMiddleware;
4
5
use Chadicus\Psr\Http\ServerMiddleware\Token;
6
7
/**
8
 * @coversDefaultClass \Chadicus\Psr\Http\ServerMiddleware\Token
9
 * @covers ::__construct
10
 */
11
final class TokenTest extends \PHPUnit\Framework\TestCase
12
{
13
    /**
14
     * Verify basic behavior of getPublicKey().
15
     *
16
     * @test
17
     * @covers ::getPublicKey
18
     *
19
     * @return void
20
     */
21
    public function getPublicKey()
22
    {
23
        $token = new Token('a public key', 'not under test', 'not under test', time());
24
        $this->assertSame('a public key', $token->getPublicKey());
25
    }
26
27
    /**
28
     * Verify basic behavior of getSignature().
29
     *
30
     * @test
31
     * @covers ::getSignature
32
     *
33
     * @return void
34
     */
35
    public function getSignature()
36
    {
37
        $token = new Token('not under test', 'a signature', 'not under test', time());
38
        $this->assertSame('a signature', $token->getSignature());
39
    }
40
41
    /**
42
     * Verify basic behavior of getNonce().
43
     *
44
     * @test
45
     * @covers ::getNonce
46
     *
47
     * @return void
48
     */
49
    public function getNonce()
50
    {
51
        $token = new Token('not under test', 'not under test', '12345', time());
52
        $this->assertSame('12345', $token->getNonce());
53
    }
54
55
    /**
56
     * Verify basic behavior of getTimestamp().
57
     *
58
     * @test
59
     * @covers ::getTimestamp
60
     *
61
     * @return void
62
     */
63
    public function getTimestamp()
64
    {
65
        $time = 1464053940;
66
        $token = new Token('not under test', 'not under test', 'not under test', $time);
67
        $this->assertSame(1464053940, $token->getTimestamp());
68
    }
69
}
70