From 8f57d46a0bbe452bb153890a08d686b39daa5614 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 20 Aug 2024 16:46:49 +0200 Subject: fix: delay calculating global cache prefix untill a cache is created Signed-off-by: Robin Appelman --- tests/lib/Memcache/FactoryTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/lib/Memcache/FactoryTest.php b/tests/lib/Memcache/FactoryTest.php index 5a1509eb3d9..b973b5065ea 100644 --- a/tests/lib/Memcache/FactoryTest.php +++ b/tests/lib/Memcache/FactoryTest.php @@ -110,7 +110,7 @@ class FactoryTest extends \Test\TestCase { $expectedLocalCache, $expectedDistributedCache, $expectedLockingCache) { $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); $profiler = $this->getMockBuilder(IProfiler::class)->getMock(); - $factory = new \OC\Memcache\Factory('abc', $logger, $profiler, $localCache, $distributedCache, $lockingCache); + $factory = new \OC\Memcache\Factory(fn () => 'abc', $logger, $profiler, $localCache, $distributedCache, $lockingCache); $this->assertTrue(is_a($factory->createLocal(), $expectedLocalCache)); $this->assertTrue(is_a($factory->createDistributed(), $expectedDistributedCache)); $this->assertTrue(is_a($factory->createLocking(), $expectedLockingCache)); @@ -124,13 +124,13 @@ class FactoryTest extends \Test\TestCase { $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); $profiler = $this->getMockBuilder(IProfiler::class)->getMock(); - new \OC\Memcache\Factory('abc', $logger, $profiler, $localCache, $distributedCache); + new \OC\Memcache\Factory(fn () => 'abc', $logger, $profiler, $localCache, $distributedCache); } public function testCreateInMemory(): void { $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); $profiler = $this->getMockBuilder(IProfiler::class)->getMock(); - $factory = new \OC\Memcache\Factory('abc', $logger, $profiler, null, null, null); + $factory = new \OC\Memcache\Factory(fn () => 'abc', $logger, $profiler, null, null, null); $cache = $factory->createInMemory(); $cache->set('test', 48); -- cgit v1.2.3