From fbf1535db116f7bec66353a4bcbd3969c9734758 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Fri, 7 Nov 2014 00:45:25 +0000 Subject: [PATCH] Renamed Adapter to AbstractStorage because it isn't actually an adapter --- src/Storage/{Adapter.php => AbstractStorage.php} | 6 +++--- .../{AdapterTest.php => AbstractStorageTest.php} | 12 ++++++------ tests/unit/Stubs/StubAbstractStorage.php | 8 ++++++++ 3 files changed, 17 insertions(+), 9 deletions(-) rename src/Storage/{Adapter.php => AbstractStorage.php} (90%) rename tests/unit/Storage/{AdapterTest.php => AbstractStorageTest.php} (51%) create mode 100644 tests/unit/Stubs/StubAbstractStorage.php diff --git a/src/Storage/Adapter.php b/src/Storage/AbstractStorage.php similarity index 90% rename from src/Storage/Adapter.php rename to src/Storage/AbstractStorage.php index e9f3f1d6..5c18e7b8 100644 --- a/src/Storage/Adapter.php +++ b/src/Storage/AbstractStorage.php @@ -1,6 +1,6 @@ @@ -14,9 +14,9 @@ namespace League\OAuth2\Server\Storage; use League\OAuth2\Server\AbstractServer; /** - * Storage adapter class + * Abstract storage class */ -class Adapter +abstract class AbstractStorage { /** * Server diff --git a/tests/unit/Storage/AdapterTest.php b/tests/unit/Storage/AbstractStorageTest.php similarity index 51% rename from tests/unit/Storage/AdapterTest.php rename to tests/unit/Storage/AbstractStorageTest.php index 1610b4d0..6b943f71 100644 --- a/tests/unit/Storage/AdapterTest.php +++ b/tests/unit/Storage/AbstractStorageTest.php @@ -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); } } diff --git a/tests/unit/Stubs/StubAbstractStorage.php b/tests/unit/Stubs/StubAbstractStorage.php new file mode 100644 index 00000000..cb920f94 --- /dev/null +++ b/tests/unit/Stubs/StubAbstractStorage.php @@ -0,0 +1,8 @@ +