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/ClientCredentialsTest.php
2016-05-07 12:59:40 +02:00

28 lines
828 B
PHP

<?php
namespace OAuth2\Storage;
class ClientCredentialsTest extends BaseTest
{
/** @dataProvider provideStorage */
public function testCheckClientCredentials(ClientCredentialsInterface $storage)
{
if ($storage instanceof NullStorage) {
$this->markTestSkipped('Skipped Storage: ' . $storage->getMessage());
return;
}
// nonexistant client_id
$pass = $storage->checkClientCredentials('fakeclient', 'testpass');
$this->assertFalse($pass);
// invalid password
$pass = $storage->checkClientCredentials('oauth_test_client', 'invalidcredentials');
$this->assertFalse($pass);
// valid credentials
$pass = $storage->checkClientCredentials('oauth_test_client', 'testpass');
$this->assertTrue($pass);
}
}