8000 - · symfony/http-foundation@8759ed5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8759ed5

Browse files
-
1 parent 48b739b commit 8759ed5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Tests/Session/Storage/Handler/MemcachedSessionHandlerTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,15 @@ protected function setUp(): void
3838
$this->markTestSkipped('Tests can only be run with memcached extension 2.1.0 or lower, or 3.0.0b1 or higher');
3939
}
4040

41-
$this->memcached = $this->createMock(\Memcached::class);
41+
$r = new \ReflectionClass(\Memcached::class);
42+
$methodsToMock = array_map(function ($m) { return $m->name; }, $r->getMethods(\ReflectionMethod::IS_PUBLIC));
43+
$methodsToMock = array_diff($methodsToMock, ['getDelayed','getDelayedByKey']);
44+
45+
$this->memcached = $this->getMockBuilder(\Memcached::class)
46+
->disableOriginalConstructor()
47+
->setMethods($methodsToMock)
48+
->getMock();
49+
4250
$this->storage = new MemcachedSessionHandler(
4351
$this->memcached,
4452
['prefix' => self::PREFIX, 'expiretime' => self::TTL]

0 commit comments

Comments
 (0)
0