commit cd37b4cc098902c6bc2155a7d52073831fff0080 Author: Moshe Weitzman Date: Thu Oct 15 13:47:42 2015 -0400 Test that entries are permanent. diff --git a/core/lib/Drupal/Core/Cache/ApcuBackend.php b/core/lib/Drupal/Core/Cache/ApcuBackend.php index a226386..b64fd71 100644 --- a/core/lib/Drupal/Core/Cache/ApcuBackend.php +++ b/core/lib/Drupal/Core/Cache/ApcuBackend.php @@ -68,7 +68,7 @@ public function __construct($bin, $site_prefix, CacheTagsChecksumInterface $chec * @return string * The APCu key for the cache item ID. */ - protected function getApcuKey($cid) { + public function getApcuKey($cid) { return $this->binPrefix . $cid; } diff --git a/core/modules/system/src/Tests/Cache/ApcuBackendUnitTest.php b/core/modules/system/src/Tests/Cache/ApcuBackendUnitTest.php index fcb5577..fafac7e 100644 --- a/core/modules/system/src/Tests/Cache/ApcuBackendUnitTest.php +++ b/core/modules/system/src/Tests/Cache/ApcuBackendUnitTest.php @@ -87,6 +87,15 @@ public function testSetGet() { return; } parent::testSetGet(); + + // Make sure entries are permanent (i.e. no TTL). + $backend = $this->getCacheBackend($this->getTestBin()); + $key = $backend->getApcuKey('TEST8'); + foreach (new \APCIterator('user', '/^' . $key . '/') as $item) { + $this->assertEqual(0, $item['ttl']); + $found = TRUE; + } + $this->assertTrue($found); } /**