aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cache/apcu_driver_test.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache/apcu_driver_test.php')
-rw-r--r--tests/cache/apcu_driver_test.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/cache/apcu_driver_test.php b/tests/cache/apcu_driver_test.php
index 9de1d82a15..57f640c313 100644
--- a/tests/cache/apcu_driver_test.php
+++ b/tests/cache/apcu_driver_test.php
@@ -49,10 +49,27 @@ class phpbb_cache_apcu_driver_test extends phpbb_cache_common_test_case
protected function setUp()
{
+ global $phpbb_container, $phpbb_root_path;
+
parent::setUp();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/');
+
$this->driver = new \phpbb\cache\driver\apcu;
$this->driver->purge();
}
+
+ public function test_purge()
+ {
+ /* add a cache entry which does not match our key */
+ $foreign_key = 'test_' . $this->driver->key_prefix . 'test';
+ $this->assertSame(true, apcu_store($foreign_key, 0, 600));
+ $this->assertSame(true, apcu_exists($foreign_key));
+
+ parent::test_purge();
+
+ $this->assertSame(true, apcu_exists($foreign_key));
+ }
}