Test Failed
Push — master ( d81d28...a65d97 )
by Charles
01:59
created

SignatureTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testV2Signatures() 0 7 2
A testV1Signatures() 0 7 2
1
<?php declare(strict_types=1);
2
3
namespace ncryptf\Tests;
4
5
use ncryptf\Tests\AbstractTest;
6
use ncryptf\Signature;
7
8
final class SignatureTest extends AbstractTest
9
{
10
    public function testV1Signatures()
11
    {
12
        foreach ($this->testCases as $k => $params) {
13
            $signature = Signature::derive($params[0], $params[1], $this->salt, $this->date, $params[2], 1);
14
15
            $hash = \explode("\n", $signature)[0];
16
            $this->assertEquals($hash, $this->v1SignatureResults[$k]);
17
        }
18
    }
19
20
    public function testV2Signatures()
21
    {
22
        foreach ($this->testCases as $k => $params) {
23
            $signature = Signature::derive($params[0], $params[1], $this->salt, $this->date, $params[2]);
24
25
            $hash = \explode("\n", $signature)[0];
26
            $this->assertEquals($hash, $this->v2SignatureResults[$k]);
27
        }
28
    }
29
}
30