aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cache
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cache')
-rw-r--r--tests/cache/common_test_case.php23
-rw-r--r--tests/cache/null_driver_test.php6
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php
index 5c387d98a1..45cf80e424 100644
--- a/tests/cache/common_test_case.php
+++ b/tests/cache/common_test_case.php
@@ -38,4 +38,27 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
$this->assertSame(false, $this->driver->get('test_key'));
}
+
+ public function test_destroy()
+ {
+ $this->driver->put('first_key', 'first_value');
+ $this->driver->put('second_key', 'second_value');
+
+ $this->assertEquals(
+ 'first_value',
+ $this->driver->get('first_key')
+ );
+ $this->assertEquals(
+ 'second_value',
+ $this->driver->get('second_key')
+ );
+
+ $this->driver->destroy('first_key');
+
+ $this->assertFalse($this->driver->_exists('first_key'));
+ $this->assertEquals(
+ 'second_value',
+ $this->driver->get('second_key')
+ );
+ }
}
diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php
index 1e8b254294..86553d4dc5 100644
--- a/tests/cache/null_driver_test.php
+++ b/tests/cache/null_driver_test.php
@@ -39,6 +39,12 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
$this->driver->purge();
}
+ public function test_destroy()
+ {
+ // does nothing
+ $this->driver->destroy('foo');
+ }
+
public function test_cache_sql()
{
global $db, $cache;