mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 05:29:52 +05:30
Renamed Adapter to AbstractStorage because it isn't actually an adapter
This commit is contained in:
parent
72e3ddad1e
commit
fbf1535db1
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* OAuth 2.0 storage adapter
|
* OAuth 2.0 abstract storage
|
||||||
*
|
*
|
||||||
* @package league/oauth2-server
|
* @package league/oauth2-server
|
||||||
* @author Alex Bilbie <hello@alexbilbie.com>
|
* @author Alex Bilbie <hello@alexbilbie.com>
|
||||||
@ -14,9 +14,9 @@ namespace League\OAuth2\Server\Storage;
|
|||||||
use League\OAuth2\Server\AbstractServer;
|
use League\OAuth2\Server\AbstractServer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Storage adapter class
|
* Abstract storage class
|
||||||
*/
|
*/
|
||||||
class Adapter
|
abstract class AbstractStorage
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Server
|
* Server
|
@ -2,22 +2,22 @@
|
|||||||
|
|
||||||
namespace LeagueTests\Storage;
|
namespace LeagueTests\Storage;
|
||||||
|
|
||||||
use League\OAuth2\Server\Storage\Adapter;
|
use LeagueTests\Stubs\StubAbstractStorage;
|
||||||
use LeagueTests\Stubs\StubAbstractServer;
|
use LeagueTests\Stubs\StubAbstractServer;
|
||||||
|
|
||||||
class AdapterTest extends \PHPUnit_Framework_TestCase
|
class AdapterStorageTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function testSetGet()
|
public function testSetGet()
|
||||||
{
|
{
|
||||||
$adapter = new Adapter;
|
$storage = new StubAbstractStorage;
|
||||||
|
|
||||||
$reflector = new \ReflectionClass($adapter);
|
$reflector = new \ReflectionClass($storage);
|
||||||
$setMethod = $reflector->getMethod('setServer');
|
$setMethod = $reflector->getMethod('setServer');
|
||||||
$setMethod->setAccessible(true);
|
$setMethod->setAccessible(true);
|
||||||
$setMethod->invokeArgs($adapter, [new StubAbstractServer]);
|
$setMethod->invokeArgs($storage, [new StubAbstractServer]);
|
||||||
$getMethod = $reflector->getMethod('getServer');
|
$getMethod = $reflector->getMethod('getServer');
|
||||||
$getMethod->setAccessible(true);
|
$getMethod->setAccessible(true);
|
||||||
|
|
||||||
$this->assertTrue($getMethod->invoke($adapter) instanceof StubAbstractServer);
|
$this->assertTrue($getMethod->invoke($storage) instanceof StubAbstractServer);
|
||||||
}
|
}
|
||||||
}
|
}
|
8
tests/unit/Stubs/StubAbstractStorage.php
Normal file
8
tests/unit/Stubs/StubAbstractStorage.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace LeagueTests\Stubs;
|
||||||
|
|
||||||
|
class StubAbstractStorage extends \League\OAuth2\Server\Storage\AbstractStorage
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user