KeyStoreHmacTest.php 499 B

12345678910111213141516
  1. <?php
  2. namespace Tests\Unit\HttpSignatures;
  3. use App\Util\HttpSignatures\KeyStore;
  4. class KeyStoreHmacTest extends \PHPUnit\Framework\TestCase
  5. {
  6. public function testFetchHmacSuccess()
  7. {
  8. $ks = new KeyStore(['hmacsecret' => 'ThisIsASecretKey']);
  9. $key = $ks->fetch('hmacsecret');
  10. $this->assertEquals(['hmacsecret', 'ThisIsASecretKey', 'ThisIsASecretKey', 'secret'], [
  11. $key->getId(), $key->getVerifyingKey(), $key->getSigningKey(), $key->getType(), ]);
  12. }
  13. }