From 2853a0952e251c302be9e37ced5a92698bfbb195 Mon Sep 17 00:00:00 2001 From: Alberto Paderno Date: Wed, 19 Feb 2025 11:58:01 +0100 Subject: [PATCH] Corrected the TTL values used in ApcStorageCacheStoreAndRetrieveTestCase::testStoreDelayRetrieveMultipleCacheItems(); added a comment to remember why those TTL values are used --- tests/apc_storage_cache.test | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/apc_storage_cache.test b/tests/apc_storage_cache.test index 662028a..cf43c27 100644 --- a/tests/apc_storage_cache.test +++ b/tests/apc_storage_cache.test @@ -393,8 +393,11 @@ class ApcStorageCacheStoreAndRetrieveTestCase extends ApcStorageCacheBaseTestCas foreach ($this->storageData() as $id => $data) { $cid = "store_retrieve_cache_item_$id"; - if ($this->assertCacheItemSaved($bin, $cid, $data['value'], $data['ttl'])) { - $max_ttl = max($max_ttl, $data['ttl']); + // The TTL values returned by + // ApcStorageCacheStoreAndRetrieveTestCase::storageData() are increased + // by two seconds to make all the stored values temporary. + if ($this->assertCacheItemSaved($bin, $cid, $data['value'], $data['ttl']+2)) { + $max_ttl = max($max_ttl, $data['ttl']+2); $stored[] = $cid; } }