| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function testCanVerifySignatureOfGivenData() |
||
| 30 | { |
||
| 31 | $key = new KeyManager; |
||
| 32 | $key->setPassphrase('gandung31337'); |
||
| 33 | $hs256 = new HS256; |
||
| 34 | $signature = $hs256->sign('this is a text.', $key); |
||
| 35 | $this->assertInternalType('string', $signature); |
||
| 36 | $this->assertNotEmpty($signature); |
||
| 37 | $isSignatureMatched = $hs256->verify($signature, 'this is a text.', $key); |
||
| 38 | $this->assertInternalType('boolean', $isSignatureMatched); |
||
| 39 | $this->assertTrue($isSignatureMatched); |
||
| 40 | } |
||
| 41 | |||
| 48 |