2014-01-16 22:21:06 +05:30
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace LeagueTests\Storage;
|
|
|
|
|
2014-11-07 06:15:25 +05:30
|
|
|
use LeagueTests\Stubs\StubAbstractStorage;
|
2014-01-16 22:21:06 +05:30
|
|
|
use LeagueTests\Stubs\StubAbstractServer;
|
|
|
|
|
2014-11-07 06:15:25 +05:30
|
|
|
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
|
|
|
{
|
2014-11-07 06:15:25 +05:30
|
|
|
$storage = new StubAbstractStorage;
|
2014-01-16 22:21:06 +05:30
|
|
|
|
2014-11-07 06:15:25 +05:30
|
|
|
$reflector = new \ReflectionClass($storage);
|
2014-01-16 22:21:06 +05:30
|
|
|
$setMethod = $reflector->getMethod('setServer');
|
|
|
|
$setMethod->setAccessible(true);
|
2014-11-07 06:15:25 +05:30
|
|
|
$setMethod->invokeArgs($storage, [new StubAbstractServer]);
|
2014-01-16 22:21:06 +05:30
|
|
|
$getMethod = $reflector->getMethod('getServer');
|
|
|
|
$getMethod->setAccessible(true);
|
|
|
|
|
2014-11-07 06:15:25 +05:30
|
|
|
$this->assertTrue($getMethod->invoke($storage) instanceof StubAbstractServer);
|
2014-01-16 22:21:06 +05:30
|
|
|
}
|
2014-05-03 15:25:25 +05:30
|
|
|
}
|