Renamed Adapter to AbstractStorage because it isn't actually an adapter

This commit is contained in:
Alex Bilbie
2014-11-07 00:45:25 +00:00
parent 72e3ddad1e
commit fbf1535db1
3 changed files with 17 additions and 9 deletions

View File

@@ -2,22 +2,22 @@
namespace LeagueTests\Storage;
use League\OAuth2\Server\Storage\Adapter;
use LeagueTests\Stubs\StubAbstractStorage;
use LeagueTests\Stubs\StubAbstractServer;
class AdapterTest extends \PHPUnit_Framework_TestCase
class AdapterStorageTest extends \PHPUnit_Framework_TestCase
{
public function testSetGet()
{
$adapter = new Adapter;
$storage = new StubAbstractStorage;
$reflector = new \ReflectionClass($adapter);
$reflector = new \ReflectionClass($storage);
$setMethod = $reflector->getMethod('setServer');
$setMethod->setAccessible(true);
$setMethod->invokeArgs($adapter, [new StubAbstractServer]);
$setMethod->invokeArgs($storage, [new StubAbstractServer]);
$getMethod = $reflector->getMethod('getServer');
$getMethod->setAccessible(true);
$this->assertTrue($getMethod->invoke($adapter) instanceof StubAbstractServer);
$this->assertTrue($getMethod->invoke($storage) instanceof StubAbstractServer);
}
}

View File

@@ -0,0 +1,8 @@
<?php
namespace LeagueTests\Stubs;
class StubAbstractStorage extends \League\OAuth2\Server\Storage\AbstractStorage
{
}