|
@@ 81-88 (lines=8) @@
|
| 78 |
|
$this->assertEquals($expected, $actual); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
public function testVerifyHashWrongKey() |
| 82 |
|
{ |
| 83 |
|
|
| 84 |
|
$this->setExpectedException('Exception'); |
| 85 |
|
$hash1 = hash_hmac($this->algo, json_encode($this->data), 'key'); |
| 86 |
|
$hash2 = hash_hmac($this->algo, json_encode($this->data), 'key2'); |
| 87 |
|
$this->hmac->verify($hash1, $hash2); |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
public function testVerifyHashNotString() |
| 91 |
|
{ |
|
@@ 98-105 (lines=8) @@
|
| 95 |
|
$this->hmac->verify($hash1, $hash2); |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
public function testVerifyHashWrongData() |
| 99 |
|
{ |
| 100 |
|
$this->setExpectedException('Exception'); |
| 101 |
|
$data = md5('someOtherStuff'); |
| 102 |
|
$hash1 = hash_hmac($this->algo, json_encode($this->data), 'key'); |
| 103 |
|
$hash2 = hash_hmac($this->algo, $data, 'key'); |
| 104 |
|
$this->hmac->verify($hash1, $hash2); |
| 105 |
|
} |
| 106 |
|
|
| 107 |
|
public function testGetPrivateKey() |
| 108 |
|
{ |