oauth2-server/tests/unit/Storage/AbstractStorageTest.php

24 lines
690 B
PHP
Raw Normal View History

2014-01-16 16:51:06 +00:00
<?php
namespace LeagueTests\Storage;
use LeagueTests\Stubs\StubAbstractServer;
2014-11-08 18:26:12 +00:00
use LeagueTests\Stubs\StubAbstractStorage;
2014-01-16 16:51:06 +00:00
2014-11-08 18:26:12 +00:00
class AbstractStorageTest extends \PHPUnit_Framework_TestCase
2014-01-16 16:51:06 +00:00
{
2014-05-03 10:55:25 +01:00
public function testSetGet()
2014-01-16 16:51:06 +00:00
{
2014-11-08 18:26:12 +00:00
$storage = new StubAbstractStorage();
2014-01-16 16:51:06 +00:00
$reflector = new \ReflectionClass($storage);
2014-01-16 16:51:06 +00:00
$setMethod = $reflector->getMethod('setServer');
$setMethod->setAccessible(true);
2014-11-08 18:26:12 +00:00
$setMethod->invokeArgs($storage, [new StubAbstractServer()]);
2014-01-16 16:51:06 +00:00
$getMethod = $reflector->getMethod('getServer');
$getMethod->setAccessible(true);
$this->assertTrue($getMethod->invoke($storage) instanceof StubAbstractServer);
2014-01-16 16:51:06 +00:00
}
2014-05-03 10:55:25 +01:00
}