$r =
new \
ReflectionClass(\Memcached::
class);
$methodsToMock =
array_map(fn ($m) =>
$m->name,
$r->
getMethods(\ReflectionMethod::IS_PUBLIC
));
$methodsToMock =
array_diff($methodsToMock,
['getDelayed', 'getDelayedByKey'
]);
$this->memcached =
$this->
getMockBuilder(\Memcached::
class) ->
disableOriginalConstructor() ->
onlyMethods($methodsToMock) ->
getMock();
$this->storage =
new MemcachedSessionHandler( $this->memcached,
['prefix' => self::PREFIX, 'expiretime' => self::TTL
] );
} public function testOpenSession() { $this->
assertTrue($this->storage->
open('', ''
));
} public function testCloseSession() {