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

24 lines
685 B
PHP
Raw Normal View History

2014-01-16 22:21:06 +05:30
<?php
namespace LeagueTests\Storage;
use LeagueTests\Stubs\StubAbstractStorage;
2014-01-16 22:21:06 +05:30
use LeagueTests\Stubs\StubAbstractServer;
class AdapterStorageTest extends \PHPUnit_Framework_TestCase
2014-01-16 22:21:06 +05:30
{
2014-05-03 15:25:25 +05:30
public function testSetGet()
2014-01-16 22:21:06 +05:30
{
$storage = new StubAbstractStorage;
2014-01-16 22:21:06 +05:30
$reflector = new \ReflectionClass($storage);
2014-01-16 22:21:06 +05:30
$setMethod = $reflector->getMethod('setServer');
$setMethod->setAccessible(true);
$setMethod->invokeArgs($storage, [new StubAbstractServer]);
2014-01-16 22:21:06 +05:30
$getMethod = $reflector->getMethod('getServer');
$getMethod->setAccessible(true);
$this->assertTrue($getMethod->invoke($storage) instanceof StubAbstractServer);
2014-01-16 22:21:06 +05:30
}
2014-05-03 15:25:25 +05:30
}