This repository has been archived on 2022-02-10. You can view files and clone it, but cannot push or open issues or pull requests.
rangitaki/vendor/bshaffer/oauth2-server-php/test/OAuth2/Storage/PublicKeyTest.php

30 lines
864 B
PHP
Raw Normal View History

2016-05-07 12:59:40 +02:00
<?php
namespace OAuth2\Storage;
class PublicKeyTest extends BaseTest
{
/** @dataProvider provideStorage */
public function testSetAccessToken($storage)
{
if ($storage instanceof NullStorage) {
$this->markTestSkipped('Skipped Storage: ' . $storage->getMessage());
return;
}
if (!$storage instanceof PublicKeyInterface) {
// incompatible storage
return;
}
$configDir = Bootstrap::getInstance()->getConfigDir();
$globalPublicKey = file_get_contents($configDir.'/keys/id_rsa.pub');
$globalPrivateKey = file_get_contents($configDir.'/keys/id_rsa');
/* assert values from storage */
$this->assertEquals($storage->getPublicKey(), $globalPublicKey);
$this->assertEquals($storage->getPrivateKey(), $globalPrivateKey);
}
}