|
@@ -32,14 +32,14 @@ discard block |
|
|
block discarded – undo |
|
32
|
32
|
$this->data = ['foo' => 'bar']; |
|
33
|
33
|
$this->privateKey = 'privateKey'; |
|
34
|
34
|
|
|
35
|
|
- $this->hmac = new HashHmac($this->privateKey,$this->algo); |
|
|
35
|
+ $this->hmac = new HashHmac($this->privateKey, $this->algo); |
|
36
|
36
|
|
|
37
|
37
|
} |
|
38
|
38
|
|
|
39
|
39
|
public function testHash() |
|
40
|
40
|
{ |
|
41
|
41
|
$actual = $this->hmac->create($this->algo, $this->data, $this->privateKey); |
|
42
|
|
- $expected = hash_hmac($this->algo, json_encode($this->data) , $this->privateKey); |
|
|
42
|
+ $expected = hash_hmac($this->algo, json_encode($this->data), $this->privateKey); |
|
43
|
43
|
$result = $this->hmac->verify($actual, $expected); |
|
44
|
44
|
$this->assertEquals(true, $result); |
|
45
|
45
|
} |
|
@@ -47,7 +47,7 @@ discard block |
|
|
block discarded – undo |
|
47
|
47
|
public function testCompareHash() |
|
48
|
48
|
{ |
|
49
|
49
|
$encodedHash = $this->hmac->getEncodedHash($this->data); |
|
50
|
|
- $this->assertEquals(true, $this->auth->compareHash($encodedHash,$this->data)); |
|
|
50
|
+ $this->assertEquals(true, $this->auth->compareHash($encodedHash, $this->data)); |
|
51
|
51
|
} |
|
52
|
52
|
|
|
53
|
53
|
public function testCompareHashInvalidAlgo() |
Please login to merge, or discard this patch.