You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
801 B
27 lines
801 B
<?php
|
|
|
|
|
|
namespace LeagueTests;
|
|
|
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
|
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
|
use League\OAuth2\Server\ResourceServer;
|
|
use Zend\Diactoros\ServerRequestFactory;
|
|
|
|
class ResourceServerTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testValidateAuthenticatedRequest()
|
|
{
|
|
$server = new ResourceServer(
|
|
$this->getMockBuilder(AccessTokenRepositoryInterface::class)->getMock(),
|
|
'file://' . __DIR__ . '/Stubs/public.key'
|
|
);
|
|
|
|
try {
|
|
$server->validateAuthenticatedRequest(ServerRequestFactory::fromGlobals());
|
|
} catch (OAuthServerException $e) {
|
|
$this->assertEquals('Missing "Authorization" header', $e->getHint());
|
|
}
|
|
}
|
|
}
|