Skip to content

Commit aadc74a

Browse files
committed
Merge branch 'ACP2E-3010' of https://github.com/adobe-commerce-tier-4/magento2ce into PR-VK-2024-06-10-CE
2 parents 4c0454b + cbbdec8 commit aadc74a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lib/internal/Magento/Framework/Cache/Backend/RemoteSynchronizedCache.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ public function load($id, $doNotTestCacheValidity = false)
223223
*/
224224
public function test($id)
225225
{
226-
return $this->local->test($id) ?? $this->remote->test($id);
226+
return $this->_options['use_stale_cache'] ?
227+
($this->local->test($id) ?? $this->remote->test($id))
228+
: $this->remote->test($id);
227229
}
228230

229231
/**

lib/internal/Magento/Framework/Cache/Test/Unit/Backend/RemoteSynchronizedCacheTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,16 @@ public function testSaveWithoutRemoteData(): void
422422

423423
$this->remoteSyncCacheInstance->save(1, 1);
424424
}
425+
426+
public function testTest(): void
427+
{
428+
$this->localCacheMockExample
429+
->method('test')
430+
->willReturn(true);
431+
$this->remoteCacheMockExample
432+
->method('test')
433+
->willReturn(false);
434+
435+
$this->assertFalse($this->remoteSyncCacheInstance->test(1));
436+
}
425437
}

0 commit comments

Comments
 (0)